Alex Rivera | Logout

Can I remove inline event handlers using jQuery?

Asked 2010-10-02T15:01:32.367
12

I have some HTML with an onclick attribute. I want to override that attribute using jQuery. Is there any way to remove the click handler using jQuery? Using unbind doesn't work.

Edit
Report

1 Answer

0

There is a plugin for it, but you should only do this when you really need to. The plugin gives you the option to call the old function or to ignore it entirely.

jQuery Override Plugin

$(divElementObj).override('onclick', 'click', function(...));
answered 2012-11-14T23:24:04.413

Your Answer