How to remove 'onclick' event in FireFox ?

Î

κÖлª

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
 
R

Randy Webb

é­ä¸­åŽ 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;
 
G

Guest

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.
 
L

-Lost

stes said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,128
Latest member
ElwoodPhil
Top