const elem = document.getElementById("input");
elem.addEventListener("keypress", (event)=> {
if (event.keyCode === 13) { // key code of the keybord key
event.preventDefault();
// your code to Run
}
});
let msg = document.getDocumentById('#message');
msg.addEventListener("keydown", (event) => {
// handle keydown
});
msg.addEventListener("keypress", (event) => {
// handle keypress
});
msg.addEventListener("keyup", (event) => {
// handle keyup
});