When you press a key, it should output the contents of the input field to the console, but in fact it displays one less character than necessary.
document.onkeypress = function(){ var text = document.getElementsByClassName("im_editable im-chat-input--text _im_text"); var input = text[0].innerText; console.log(input); } Example: “Hello” is entered - “Prive” is displayed.
innerText. Usekeyup. - Igor