title: Disable onbeforeunload for links
body: <p>How can I disable onbeforeunload for links?</p>
  
  <pre><code>var show = true;
  
  function showWindow(){
      if(show){      
          alert('Hi');
          return "Hi Again";
      }
  }
  
  
  $('a').click(function(){
  
      show = false;
  
  });
  
  
  window.onbeforeunload = showWindow;
  </code></pre>
  
  <p>This is what I have, but it still shows when I click on an 'a' element</p>
  
  <p>Button code:</p>
  
  <pre><code>&lt;button type="submit" class="submitBtn"&gt;&lt;span&gt;Open Account&lt;/span&gt;&lt;/button&gt;
  </code></pre>