By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,715 Members | 1,219 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,715 IT Pros & Developers. It's quick & easy.

if hyperlink has onclick overridden, then how do I later reset default behavior

P: n/a

Imagine I've a function called suprise and I've a link called
goSomewhereCool and I do this:

document.getElementById('goSomewhereCool').onclick = surprise;

Now later I want to reset the onClick of the link so it just does what
you'd expect from a link - when you click on it you go the URL that is
in its href property. How do I remove surprise from the onclick and
make the link go back to normal?

Oct 16 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
VK

Jake Barnes wrote:
Imagine I've a function called suprise and I've a link called
goSomewhereCool and I do this:

document.getElementById('goSomewhereCool').onclick = surprise;

Now later I want to reset the onClick of the link so it just does what
you'd expect from a link - when you click on it you go the URL that is
in its href property. How do I remove surprise from the onclick and
make the link go back to normal?
document.getElementById('goSomewhereCool').onclick = null;
Oct 16 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.