title: Disable/enable anchor tag using JavaScript
body: <p>I am trying to enable an anchor element using JavaScript but it looks like I am having some syntax issues. The disable part works fine but the anchor is not getting enabled after a time interval. </p>
  
  <p>Form:</p>
  
  <pre><code>&lt;a id="downloadReportLink"
     href="#x"
     title="This function will provide you a 30 day download of all your eSign transactions."
     onclick="document.getElementById('viewIntegrationReport').submit(), doEverything(this)"&gt;
  
     &lt;span&gt;Export E-Sign Information&lt;/span&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>JS functions:</p>
  
  <pre><code>function disableLink(link) {
      link.onclick = function(event) {
          event.preventDefault();
      }
  }
  
  function enableLink(link) {
      link.onclick = undefined;
  }
  
  function doEverything(link) {
      disableLink(link);
      setTimeout(function() {
              enableLink(link);
          },
          4000
      );
  }
  </code></pre>
  
  <p>I assumed <code>link.onclick = undefined</code> would enable the anchor but it does not. </p>
  
  <p>Am I doing anything wrong here?</p>