我有这个:
function tp_visible(action){
if(action==1){
document.getElementById("tp").style.display='block';
document.getElementById("tp_action").onclick='tp_visible(0);
return false;';
}
else {
document.getElementById("tp").style.display='none';
document.getElementById("tp_action").onclick='tp_visible(1);
return false;';
}
return false;
}
为什么上述代码没有改变onclick
事件?
我使用Firebug,但事件仍然保持不变...
以下是HTML代码:
<a
id='tp_action'
name='tp_action'
href='#'
onclick='tp_visible(1);
return false;'
>Show info</a>