how to remove event listener in jquery

JavaScript
// adding an event listener using jQuery
$('h1').click(()=>{
    console.log('clicked')
})

// unbinding event listener
$('h1').unbind()//Remove all event handlers from all paragraphs:

$( "p" ).off();

//Remove all delegated click handlers from all paragraphs:

$( "p" ).off( "click", "**" );var div = $("div").detach();

$(div).appendTo("body");
Source

Also in JavaScript: