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

click() method and Firefox

P: n/a
hi,

with the following anchor objeck: <a id="ref" href.......>...</a>
this code:
document.getElementById("ref").click();
works on IE 6 but not on Firefox 1.0
the error message is: document.getElementById("ref").click is not a
function..
I'll be happy if you could tell me why and how to solve?

Thanks
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Lee
Aziz said:

hi,

with the following anchor objeck: <a id="ref" href.......>...</a>
this code:
document.getElementById("ref").click();
works on IE 6 but not on Firefox 1.0
the error message is: document.getElementById("ref").click is not a
function..
I'll be happy if you could tell me why and how to solve?


Instead, use this code:

location="whatever the href value of that link happens to be";

Jul 23 '05 #2

P: n/a
Try the following:
<a id="ref" href="new.html" onclick="location.href='new.html'">...</a>

document.getElementById("ref").onclick();

This will work in Firefox.
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.