欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jquery設(shè)置按鈕停頓3秒不可用

 更新時(shí)間:2014年03月07日 16:12:42   作者:  
設(shè)置按鈕停頓3秒不可用的方法有很多,下面為大家介紹下使用jquery是如何實(shí)現(xiàn)的
復(fù)制代碼 代碼如下:

<!DOCTYPE html>
<html>
<head>
<title> my name is lian lily</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">

var times = 0
function show(obj) {
$("#btn_"+obj).attr("disabled","disabled");//設(shè)置button不可用
times++;
if(times == 2){
alert(obj);
times = 0;
$("#btn_"+obj).removeAttr("disabled");
return ;
}
//$("#frm"+obj).submit();
setTimeout("show("+obj+")" , 3000);
}
</script>
</head>

<body>
<form action ='post.php' method="post" name="frm1" id="frm1">
<input type="button" name="btn_1" id="btn_1" value="提交1" onclick="show(1)" />
</form>

<form action ='post.php' method="post" name="frm2" id="frm2">
<input type="button" name="btn_2" id="btn_2" value="提交2" onclick="show(2)"/>
</form>
</body>
</html>

相關(guān)文章

最新評(píng)論