25
rated 0 times
[
31]
[
6]
/ answers: 1 / hits: 77945
/ 14 Years ago, tue, april 13, 2010, 12:00:00
This seems deceptively simple.
How do you override the onclick event in the following HTML using JavaScript?
<a id=sample href=... onclick=alert('hello world') />...</a>
I've tried it with jQuery, but that didn't do the trick:
$('#sample').attr('onclick','alert(done)')
Assume the HTML is pre-written and cannot be changed, other than manipulating it with JavaScript.
More From » html