Presently, I have this code snippet:
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;
}
However, the onclick
event is not changing as expected.
When inspecting with Firebug, it appears that the event remains unchanged...
Below is the corresponding HTML element:
<a
id='tp_action'
name='tp_action'
href='#'
onclick='tp_visible(1);
return false;'
>Show info</a>