同意按钮,倒计时10秒
2016-03-26 16:29
197 查看
<!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <body> <form> <input type="submit" id="t" value="同意(9)" disabled="disabled" /> </form> </body> </html> <script> var n=10; var a=document.getElementById("t"); function bian() { n--; if(n==0) { a.removeAttribute("disabled"); a.value="同意"; return; } else { a.value="同意("+n+")"; window.setTimeout("bian()",1000); } } window.setTimeout("bian()",1000); </script>
View Code
相关文章推荐
- PAT (Advanced Level) Practise 1108 Finding Average (20)
- 47. Permutations II
- 非静态内部类造成的内存泄漏
- 浅谈sdk的开发与设计
- javascript时间戳的坑
- Spring 定时器配置
- 如何实现一个简单的MVVM框架
- 求最大子数组
- java IO流 总结(未完)
- Java多线程之线程协作
- SAS中生成哑变量的一段宏代码
- UML的9种图例解析
- 计蒜客|C++程序设计|二维数组
- Mysql 常用函数
- MySQL存储过程详解及mysql基本函数
- getClass()和getClassLoader()区别 以及ClassLoader详解及用途(文件加载,类加载)
- HDU1021-Fibonacci Again,,找规律就好了~~~
- 最近总结
- Java网络编程(UDP协议-聊天程序)
- 奇异值分解(SVD)与线性变换的几何意义