How to enable on click after removing it?
<p>I have two conditions here, cond1 and cond2 .If its the cond1 I will disable my <code>onclick</code> event, else I will enable it.</p>

<p>This is what I fished out :</p>

<pre><code>if(cond1) {
    document.getElementById('mTag').removeAttribute("onclick");
} else {
    document.getElementById('mTag').setAttribute('onclick');
}
</code></pre>

<p>The problem is once the <code>onclick</code> gets disabled , its not getting enabled again. If its <code>cond2</code> , then it must be enabled . What am I doing wrong? Kindly suggest some solution to this.</p>
