I have a button inside a div to hide this div, and I want to pass the div to the handler. Here is my current code:
$('#hidden-div').on('click', '#hide-btn', { element : $('#hidden-div') }, hideElement);
Is there a way to avoid reselecting a container? Something like this would be nice:
$('#hidden-div').on('click', '#hide-btn', { element : $(this) }, hideElement);
source
share