Send message on pressing enter #21

Merged
H4CK3R-01 merged 1 commits from chat_fix into main 2021-06-11 06:50:58 +00:00

View File

@ -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();
}
};