I've made oninput for div with a class. I can't add an ID to the div. So here is my script:
var objecto = document.getElementsByClassName(" nicEdit-main ")[0];
objecto.oninput = function() {
alert("Ok!");
}
Here is my HTML:
<div class=" nicEdit-main " style="width: 499px; margin: 4px; min-height: 149px; overflow: hidden;" contenteditable="true">1123215545<br></div>
Why does oninput not work for this div?