ARPIT ANAND

ARPIT ANAND

1 Articles Published

Articles by ARPIT ANAND

1 articles

How to check if onClick exists on element in jQuery?

ARPIT ANAND
ARPIT ANAND
Updated on 14-Feb-2020 854 Views

These codes might help you −$('body').click(function(){ alert('test' )}) var foo = $.data( $('body').get(0), 'events' ).click // you can query $.data( object, 'events' ) and get an object back, then see what events are attached to it.  $.each( foo, function(i,o) {     alert(i) // guid of the event     alert(o) // the function definition of the event handler });

Read More
Showing 1–1 of 1 articles
« Prev 1 Next »
Advertisements