Send message on pressing enter #21
@ -67,4 +67,11 @@ function addChatMessage(data) {
|
||||
messageDiv.appendChild(messageBody);
|
||||
|
||||
document.getElementById('messages_received').append(messageDiv);
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById('message_input').onkeydown = function (e) {
|
||||
if (e.key === "Enter") {
|
||||
sendMessage();
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user