Answer the question
In order to leave comments, you need to log in
How to remove the oninput property from an element?
Hello. How can you remove the oninput property from a normal element? I tried unbind, off - does not help. Thanks in advance!
Answer the question
In order to leave comments, you need to log in
<input type="text">
<button>Удалить обработчик события</button>
var inp = document.querySelector('input');
inp.oninput = function(){
console.log(this.value);
};
document.querySelector('button').addEventListener('click', function(){
inp.oninput = null;
}, false);
Sandbox example
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question