I have it:
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; }
Why doesn't this mean changing the onclick event?
I am using Firebug and the event remains the same ...
Here is the HTML:
<a id='tp_action' name='tp_action' href='#' onclick='tp_visible(1); return false;' >Show info</a>
user188962
source share