} else {
            var line = document.createElement('div');
            line.innerHTML = '<span>[' + data.nickname + ']</span> ' + data.msg + ' <span class="datetime">' + data.datetime + '</span>';
            document.getElementById('msg').appendChild(line);
        }
    };
    function send(e, input) {
        if (e.charCode == 13) {
            ws.send(input.value);
            input.value = '';
        }
    }
</script>

</body>

</html>