title: How do I make a download link open in a new browser tab when clicked and set a countdown on that tab before the file download link appears
body: <p>Hello coders in the house.
  I am a complete beginner, I saw something on <code>thewpclub.Net</code> and I want to implement the same on my <code>Wordpress</code> blog.</p>
  
  <p>When someone clicks a download link, I want a new browser tab to open and display a countdown timer like 15 seconds before the main download link will now appear.</p>
  
  <p>Pls try and download from thewpclub. Net , you will understand what am trying to say.</p>
  
  <p>What I have tried:</p>
  
  <p>A friend on facebook gave me this jquery code.</p>
  
  <p>But after I paste it in my blog.
  The countdown just happens right away on the same post page. It doesn't even wait for user to click the link not to talk of opening a new tab.</p>
  
  <p>See the code below</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function c() {
      var startTime = $('.c').attr('id');
      var counter = startTime;
      $('.c').text(counter);
  
      setInterval(function() {
          counter--;
  
          if (counter &gt; 0) {
              $('.c').text(counter);
          }
          // Display 'counter' wherever you want to display it.
          if (counter === 0) {
              // alert('this is where it happens');
              clearInterval(counter);
              $('.c').text('');
              $('.c').append('&lt;a href="#"&gt;Download&lt;/a&gt;');
          }
      }, 1000);
  }
  // Start
  c();</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;span class="c" id="5"&gt;&lt;/span&gt;</code></pre>
  </div>
  </div>
  </p>