Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 31st, 2012  |  syntax: None  |  size: 0.52 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Toggle click function of a anchor after click
  2. <a id="myLocation" class="locator" href="#" onclick="javascript:getMyLocation();">&nbsp;&nbsp;&nbsp;&nbsp;My Location</a>
  3.        
  4. document.getElementById("myLocation").onclick = RemoveLocation;
  5.        
  6. document.getElementById("myLocation").onclick = getMyLocation;
  7.        
  8. function getMyLocation() {
  9.  
  10.     ...
  11.  
  12.     document.getElementById("myLocation").onclick = RemoveLocation;
  13. }
  14.  
  15.  
  16. function RemoveLocation() {
  17.  
  18.     ...
  19.  
  20.     document.getElementById("myLocation").onclick = getMyLocation;
  21. }