jQuery On click function
a single handler for all elements that match your selector, including the ones created dynamically.
If you add a handler with .on(“click”, handler) you normally remove it with .off(“click”, handler) which will remove that very handler. Obviously this works only if you have a reference to the function
on Click event with jQuery
$(document).on('click', '#selector', function(){ #do your code });
The jQuery click event.
Was this post helpful?
Let us know if you liked the post. That’s the only way we can improve.
Yes0
No0