发送验证码

<!doctype html>
<html>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Amaze UI Examples</title>
<link rel="stylesheet" href="css/amazeui.min.css">
<!-- <link rel="stylesheet" href="assets/css/app.css">-->
</head>
<body>
<input name="" type="text" defaulttxt="请输入短信验证码" />
<input name="" type="button" id="btn" value="发送验证码"/>
<!--[if (gte IE 9)|!(IE)]><!-->
<script src="js/jquery.min.js"></script>
<!--<![endif]-->
<script>
var wait=60;
function time(o) {
if (wait == 0) {
o.removeAttribute("disabled");
o.value="重新获取";
wait = 60;
} else { // www.jbxue.com
o.setAttribute("disabled", true);
o.value="发送验证码(" + wait + ")秒";
o.style.backgroundColor="#f0f0f0";
wait--;
setTimeout(function() {
time(o)
},
1000)
}
}
document.getElementById("btn").onclick=function(){time(this);}
/*$(function aa(){
$('button').click(function (){
$(this).parents('body').fadeOut(1000);
event.stopPropagation();
location.href='txkd.html'
})
})*/
$(function(){
$('body').fadeIn(1000);
})
setDefaultTxt();
</script>
</body>

</html>

原文地址:https://www.cnblogs.com/zhouyx/p/4788970.html