Prevent javascript execution
<pre><code>&lt;div onclick="AutogeneratedMethod()"&gt;
&lt;span&gt;SPAN 1 : I require auto method &lt;/span&gt;
&lt;span onclick="DesiredMethod()"&gt;SPAN 2 : I do not require auto method&lt;/span&gt;
&lt;/div&gt;
</code></pre>

<p>In the above code sample, how do I prevent calling the <code>AutogeneratedMethod()</code> when the user clicks on the <code>SPAN 2</code>? I do not have any control on the declaration of the <code>div</code> and its respective <code>onclick</code> behavior. That line is auto-generated from the framework I am using.</p>

<p>I'm looking for something that would kill Javascript execution at the end of the <code>DesiredMethod()</code>. Something like this:</p>

<pre><code>function DesiredMethod() {
//Do necessary stuff
exit; //Abort any further Javascript
}
</code></pre>
