title: Disable Anchor tag and remove underline also in javascript
body: <p>I have a anchor tag which I would like to disable or enable depending upon some condition. I am able to achive this using the following function:</p>
  
  <pre><code>function disableEnableAnchor(obj, disable) {
      if(disable) {
          var href = obj.getAttribute("href");
          if(href &amp;&amp; href != "" &amp;&amp; href != null)
              obj.setAttribute('href_bak', href);
          obj.removeAttribute('href');        
      } else {
          var href_bak = obj.attributes['href_bak'].nodeValue;        
          obj.setAttribute('href', href_bak);
      }
  }
  </code></pre>
  
  <p>But I am not able to remove the underline when the anchor is in a disabled state. How can I achieve this inside this function?</p>