标签:submit timeout set attr return 倒计时 turn rip input
<body>
<form>
<input type="submit" id="a" value="同意(10)" disabled="disabled" />
</form>
</body>
</html>
<script>
n=10;
a=document.getElementById("a");
function b(){
n--;
if(n==0){
a.removeAttribute("disabled");
a.value="同意";
// return;
}
else{
a.value="同意("+n+")";
window.setTimeout(b,1000);
}
}
window.setTimeout(b,1000);
</script>
标签:submit timeout set attr return 倒计时 turn rip input
原文地址:http://www.cnblogs.com/m110/p/7607060.html