javascript - jQuery check if onClick exists on element -
I found the way but it does not work on events that have not been delegated by jQuery ... < / P>
When I try,
$ ("a"). Data ("events");
For this.
& lt; A href = "#" onClick = "warning ('hello, world!')" / & Gt;
It's essentially back.
Is there any way to check that elements with onClick exist with jQuery?
Thank you.
You can do this:
if ($ (' A '). Attr ("onClick")! = Undefined) {}
Comments
Post a Comment