How to stop countdown from counting up? <p>I don't know how to stop my countdown from counting up. I used <code>countdown.js</code> and <code>jquery.min.js</code> attached to my script. What should I add to accomplish this? Here is my sample code:</p> <pre><code>&lt;?php $query = "select length_queue, extract(year from (ia_time)), extract(month from (ia_time)), extract(day from (ia_time)), ia_time, serving_time, hour(waiting_time), minute(waiting_time), second(waiting_time) from sys_table"; $i = 0; $dsplay = mysql_query($query); while($row = mysql_fetch_row($dsplay)) { $hr = $row[6]; $min = $row[7]; $sec = $row[8]; ?&gt; &lt;tr&gt; &lt;th height="33"&gt;&lt;strong&gt;&lt;?php echo $row[0]; ?&gt;&lt;/strong&gt;&lt;/td&gt; &lt;th&gt;&lt;?php echo $row[4]; ?&gt;&lt;/td&gt; &lt;th&gt;&lt;?php echo $row[5]; ?&gt;&lt;/td&gt; &lt;th&gt;&lt;span id="countdown-holder_&lt;?=$i?&gt;" class="ct" &gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;script type="text/javascript"&gt; $('.ct').each(function(){ var clock = document.getElementById("countdown-holder_&lt;?=$i++?&gt;"), targetDate = new Date(2016, 02, 27, &lt;?php echo $hr;?&gt;, &lt;?php echo $min;?&gt;, &lt;?php echo $sec;?&gt;) ; clock.innerHTML = countdown(targetDate).toString(); setInterval(function(){ clock.innerHTML = countdown(targetDate).toString(); }, 1000); }); // end of function &lt;/script&gt; &lt;?php } // END of while loop ?&gt; </code></pre>