title: How to enable/disable Anchor Tag
body: <p>Below example is working for enable/disable of href but not for <strong>onclick</strong>. I need to enable/disable for both attributes</p>
  
  <p>Note: I cant simply remove/bind the onclick event to dummy function() as it need once we enable it.</p>
  
  <p>Script Code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
   $(document).ready(function () {
       $("#b1").click(function () {
           $("#yahoo").attr("disabled", "disabled");
           $("#yahoo").css("background-color", "silver");
       })
  
       $("#b2").click(function () {
           $("#yahoo").removeAttr("disabled");
           $("#yahoo").css("background-color", "white");
       })
  
       $("#yahoo").click(function (e) {
           if ($("#yahoo").attr("disabled") == "disabled") {
               e.preventDefault();
           }
       });
   });
  &lt;/script&gt;
  </code></pre>
  
  <p>HTML Code:</p>
  
  <pre><code> &lt;div&gt;
     &lt;input type="button" id="b1" value="Disable Yahoo Link"&gt; 
     &lt;input type="button" id="b2" value="Enable Yahoo Link"&gt;    
   &lt;/div&gt;    
   &lt;a id="yahoo" target="_blank" href="javascript:alert('href alert')" onclick="javascript:alert('onclick alert')"&gt;Yahoo.com&lt;/a&gt;
  </code></pre>
  
  <p>Working Example
  <a href="http://jsfiddle.net/nunnakirankumar/suYe4/" rel="nofollow">http://jsfiddle.net/nunnakirankumar/suYe4/</a></p>