Jquery实现倒计后可操作
2014-02-21 16:47
411 查看
<!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>
<title>无标题页</title>
<script src="../js/jquery-1.4.2.js" type="text/javascript"></script>
<script type="text/javascript">
var time=9;
var intervalId;
$(function(){
intervalId=setInterval("init()",1000);
});
function init(){
time--;
if(time>=0){
$("#sub").attr("disabled",true);
$("#sub").val("倒计时"+time+"秒");
}
else{
$("#sub").attr("disabled",false);
$("#sub").val("确认提交");
clearInterval(intervalId);
}
}
</script>
</head>
<body>
<input type="text" value="请仔细阅读条款,点击确定提交信息!" />
<input type="button" value="确认提交" id="sub" disabled="disabled"/>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script src="../js/jquery-1.4.2.js" type="text/javascript"></script>
<script type="text/javascript">
var time=9;
var intervalId;
$(function(){
intervalId=setInterval("init()",1000);
});
function init(){
time--;
if(time>=0){
$("#sub").attr("disabled",true);
$("#sub").val("倒计时"+time+"秒");
}
else{
$("#sub").attr("disabled",false);
$("#sub").val("确认提交");
clearInterval(intervalId);
}
}
</script>
</head>
<body>
<input type="text" value="请仔细阅读条款,点击确定提交信息!" />
<input type="button" value="确认提交" id="sub" disabled="disabled"/>
</body>
</html>
相关文章推荐
- 解密jQuery内核 样式操作
- 时间Date,自动走动
- 26个Jquery使用小技巧
- Jquery实现倒计时跳转到指定页面或关闭窗口
- 学习jQuery必须知道的几种常用方法
- JQuery实现全选、取消全选、反向选择
- 【转载】使用jquery做类似搜索引擎效果
- jquery左侧导航网页菜单
- JQuery中each解析
- jquery 实现页面参数传递,并获取相关请求参数
- 精心挑选的12款优秀 jQuery Ajax 分页插件和教程
- JQuery的ajax同步和异步的区别(async属性)
- 类数组(like array)
- jQuery操作CheckBox的方法(选中,取消)
- 你可能不需要 jQuery!使用原生 JavaScript 进行开发
- dom对象与jquery对象的区别
- jQuery验证控件jquery.validate.js使用说明+中文API
- 富文本编辑器kindeditor设置篇
- 对于Jquery Dialog插件在frameset中的使用
- jQuery Mobile 页面过渡