how to remove addeventlistener div jquery code example
Example 1: javascript remove event listener
var someEventHander=function(event){
console.log("do something");
}
//add listener
document.getElementById("someid").addEventListener('click',someEventHander);
//remove listener
document.getElementById("someid").removeEventListener('click',someEventHander);
Example 2: how to remove event listener in jquery
// adding an event listener using jQuery
$('h1').click(()=>{
console.log('clicked')
})
// unbinding event listener
$('h1').unbind()