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

How to remove 'onclick' event in FireFox ?

P: n/a
Code like :
-------------------------------
<img src="xxx.gif" id="top_menu_4" onclick="main_menu_select(this)">
I want to remove the onclick event:
-------------------------------
window.$ = function(name)
{
return document.getElementById(name);
};
$("top_menu_4").removeEventListener("onclick", main_menu_select,
false)

But it can't work in Firefox

Jun 18 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
$("top_menu_4").removeEventListener("click", main_menu_select,
false)

Jun 18 '07 #2

P: n/a
On 6 18 , 2 36 , stes <arabadj...@gmail.comwrote:
$("top_menu_4").removeEventListener("click", main_menu_select,
false)

I tried the above code, It can't work also;

Jun 18 '07 #3

P: n/a
**华 said the following on 6/18/2007 2:30 AM:
Code like :
-------------------------------
<img src="xxx.gif" id="top_menu_4" onclick="main_menu_select(this)">
I want to remove the onclick event:
-------------------------------
window.$ = function(name)
{
return document.getElementById(name);
};
$("top_menu_4").removeEventListener("onclick", main_menu_select,
false)
document.getElementById('top_menu_4').onclick=null ;

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 18 '07 #4

P: n/a
On 6 18 , 4 05 , Randy Webb <HikksNotAtH...@aol.comwrote:
document.getElementById('top_menu_4').onclick=null ;
It can work now, thank you.
but it seems very strange, I haven tried:

document.getElementById('top_menu_4').onclick="";

but it does not work properly.
Jun 18 '07 #5

P: n/a
what is the error?
do you have frame(s)/iframe?

Jun 18 '07 #6

P: n/a
stes wrote:
what is the error?
do you have frame(s)/iframe?
Always quote what you respond to. People may be willing to help you,
but may not be willing to hunt down what in the heck you are replying
to, to figure it out.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Jun 18 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.