<script> var second=20; function time(){ if(second<=9){second="0" + second;} if(document.getElementById){t.innerHTML=second;} if(second==00){return false;} second--; setTimeout("time()", 1000); } </script> The simplest version of the counter, the question is how to implement the termination of the counter failure when reloading the page, that is, 20 ... 19 ... reload ... 14 ... 15, etc.?