<!doctype?html> <html> <head> ????<meta?charset="UTF-8"> <title>send?Validate?Code</title> <script?type="text/javascript"> window.onload=function(){ ???var?send=document.getElementById('send'), ???????times=60, ???????timer=null; ???send.onclick=function(){ ?????//?計時開始 ??????????if(timer){ ??????????????clearInterval(timer); ??????????} ?????send.value=''+times+'秒后重試' ?????clearInterval(timer); ??????????timer?=?setInterval(function(){ ??????????????if(times?>?0){ ???????????????times--; ????????????????send.value=''+times+'秒后重試'; ??????????????}else{ ???????????????clearInterval(timer); ????????????????timer=null; ????????????????send.disabled=false; ???????????????send.value='發(fā)送驗證碼'; ??????????????} ????????????},1000) ???} } </script> </head> <body> <input?type="button"?id="send"?value="發(fā)送驗證碼"> </body> </html>

xiangxing98
2014-10-06
舉報
0/150
提交
取消