cancel onClick javascript functions with another javascript
<p>HI there,</p>

<p>this is a little sticky situation and I need some advice.</p>

<p>I have a couple of href's like this, across my project. </p>

<pre><code>&lt;a class="not-allowed" href="javascript:void(0)" onclick="showSettingDiv();"&gt;Change&lt;/a&gt;
&lt;a class="" href="javascript:void(0)" onclick="DeleteSettingDiv();"&gt;Delete&lt;/a&gt;
</code></pre>

<p>Depending on the type of user logged in, I have to have some links do nothing and trigger something else. </p>

<p>I have this function to make that happen:</p>

<pre><code>$('.not-allowed').each(function (e) {
    $(this).click(function (e) {
        e.preventDefault();
        alert("you dont have permission");
     })
 });
</code></pre>

<p>This does fire up the alert, however, it also executes my onclick function too. is there a way I Can stop all javascript functions and execute just this above one?</p>

<p>I realized I could just use <code>.removeAttr()</code> but I am not sure if thats the best way. I mean I might have buttons to restrict or checkbox and radio button to disable. </p>

<p><code>e.preventDefault</code> will not take care of all that I guess. Anyway, How do I prevent all javascript functions ?</p>

<p>Thanks.</p>
