
Untitled
By: a guest on
Jul 31st, 2012 | syntax:
None | size: 0.52 KB | hits: 11 | expires: Never
Toggle click function of a anchor after click
<a id="myLocation" class="locator" href="#" onclick="javascript:getMyLocation();"> My Location</a>
document.getElementById("myLocation").onclick = RemoveLocation;
document.getElementById("myLocation").onclick = getMyLocation;
function getMyLocation() {
...
document.getElementById("myLocation").onclick = RemoveLocation;
}
function RemoveLocation() {
...
document.getElementById("myLocation").onclick = getMyLocation;
}