javaScript实现简单网页倒计时代码
<div id="button"> <input type="button" value="同意" id="b01" disabled="disabled" onclick="window.close()"/> </div> </body> </html> <script> var a = document.getElementById("b01"); var i = 10; function sub(){ setTimeout("sub()",1000); if(i == 1){ a.value="同意"; a.removeAttribute("disabled"); return; }else{ a.value="同意"+"("+(--i)+")"; } } </script>