beiz
<!DOCTYPE html>
<html>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">
<title>倒计时</title>
<head> 
</head>
<body>
	<input type="button" value="获取验证码" id="getCheckNum"/>
<script type=\'text/javascript\'>
	var wait = 60;
	var Bvalue = document.getElementById("getCheckNum");
	function changetime() { 
		if (wait == 0) { 
		Bvalue.disabled = 0;
			Bvalue.value = "重新获取"; 
			wait = 60; 
		} 
		else { 
			Bvalue.disabled = 1;
			Bvalue.value= "已发送("+ wait + "s)"; 
			wait--; 
			setTimeout(function() { changetime(); }, 100); 
		} 
	}
	Bvalue.onclick = function(){
		changetime();
	};
</script>
</body> 
</html>

 

分类:

技术点:

相关文章:

  • 2022-03-10
  • 2023-03-20
  • 2021-12-18
  • 2021-12-24
  • 2021-07-10
  • 2021-09-14
  • 2022-12-23
猜你喜欢
  • 2021-12-04
  • 2021-11-30
  • 2021-12-03
  • 2021-07-09
  • 2021-12-04
  • 2022-01-01
相关资源
相似解决方案