标签:nal element input 标题 init 时间 return css char
倒计时
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>网页标题</title> <meta name="keywords" content="关键字列表" /> <meta name="description" content="网页描述" /> <link rel="stylesheet" type="text/css" href="" /> <style type="text/css"></style> <script type="text/javascript"> window.onload=init; var i=60; function init(){ if(i<=-1){ i=0; alert(‘时间到请停止作答‘); return false; } var daoObj=document.getElementById(‘dao‘); daoObj.value=‘倒计时‘+i+‘秒‘; window.setTimeout(‘init()‘,1000); i--; } </script> </head> <body> <input id=‘dao‘ type=‘botton‘ value=‘倒计时0秒‘> </body> </html>
标签:nal element input 标题 init 时间 return css char
原文地址:http://www.cnblogs.com/liujinrui/p/6147937.html