title: How to create a countdown timer with jQuery?
body: <p>I'll have more than one of these small boxes on my site, and each will start counting down at different times.</p>
  
  <p>How can I decrease the numerical value of the timer per second, giving the simulation of a countdown timer? </p>
  
  <p><img src="https://i.stack.imgur.com/OZzTZ.png" alt="enter image description here"></p>
  
  <pre><code>&lt;p class="countdown"&gt;15&lt;/p&gt;
  </code></pre>
  
  <p>Using this javascript it correctly countsdown, but every single auctionbox is affected. How would you suggest I isolate the timer to act on only one item?</p>
  
  <pre><code>&lt;script&gt;
  var sec = 15
  var timer = setInterval(function() {
     $('.auctiondiv .countdown').text(sec--);
     if (sec == -1) {
        $('.auctiondiv .countdown').fadeOut('slow');
        clearInterval(timer);
     }
  }, 1000);
  &lt;/script&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/1fliN.png" alt="enter image description here"></p>