Hi,
I'm guessing you're not in control of the HTML generation (e.g.,
you're getting it from some other thing -- a content management
solution, another site, whatever -- and don't have direct control over
it). If you *are* in control of the HTML generation, just don't
output the onclick attribute in the first place.
This came up a while back in the forums: Wanting to supersede a DOM0
event handler (e.g., a handler assigned via onclick rather than more
modern ways like those used by Element#observe). Here's a function
that looks for a button called btnGo and replaces its DOM0 handler
with a new handler, and even chains to the DOM0 handler afterward:
http://pastie.org/541315
The HTML page this would go on would have this button somewhere:
<input type='button' id='btnGo' value='Go' onclick='alert("\"Go\" got
clicked!");'/>
Obviously that's not generalized, but it should get you pointed the
right way...
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available