Basically, I just want to select every node that has the attribute onclick
regardless of its value.
I tried this, but it does not work: $('[onlick]')
If you add a c
in the between the n
and l
in onlick
it will work: $('[onclick]')
You can see it working here.
Try it in an Event Handler in IE9, wont work.
$j(document).ready(function(){
$j('[onclick]').addClass('turnedOff');
$j('body').on('click', function(event) {
setTimeout(function(event) {
$j('[onclick]').removeClass('turnedOff');
}, 3000);
});
});
The second $j('[onclick]') fails. I had to create a function that removed the class.
This was part of an effort to turn off onclicks on a page covered up in Asyn Ajax calls. a bad hack to fix bad design. But it did show that the $j('[onclick]') will not work in event handlers in IE9 The
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With