Toggle click function of a anchor after click
<p>Is it possible to change which onclick javascript function is executed after an anchor is clicked?</p>

<p>Example:</p>

<pre><code>&lt;a id="myLocation" class="locator" href="#" onclick="javascript:getMyLocation();"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;My Location&lt;/a&gt;
</code></pre>

<p>When the user clicks this anchor their location is displayed on a map with a marker.</p>

<p>I want the onclick to change to RemoveLocation() now so that when they click the anchor again is removes the marker for their location on the map.</p>

<p>getMyLocation() and RemoveLocation are already written I just need to change the onclick event after a user clicks the anchor, if possible.</p>
