mixing my jQuery click events with existing object's onclick attribute
I'm using jQuery but dealing with markup produced from JSF pages. A lot of the elements have onclick attributes provided by the JSF code (which isn't my realm). Example: <div onclick="[jsf js to submit form and go to next page]">submit</div> I'm trying to add some client side validation with jQuery. I need something like this pseudo code: $('div').click(function(e){ if(myValidation==true){ // do nothing and let the JS in the onlick attribute do its thing } else { $error.show(); // somehow stop the onclick attribute JS from firing } }) Is there a best-practice for handling this? One thought I