-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
64 lines (61 loc) · 1.98 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>注册</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
<link rel="stylesheet" href="css/rem.css">
<link rel="stylesheet" href="https://at.alicdn.com/t/font_793301_ssczj2jw8zn.css">
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<header>
<input type="text" placeholder="请输入手机号" class="phone">
<input type="text" placeholder="请输入验证码" class="yanzheng">
<input type="password" placeholder="请输入密码" class="password">
<div class="yanzhengma">获取验证码</div>
<div class="daojishi"><span>60</span>s</div>
<div class="ture">
<i class="iconfont icon-dui"></i>
</div>
<a href="denglu.html"><div class="denglu">登录</div></a>
</header>
</body>
</html>
<script>
let yanzhengma=document.querySelector(".yanzhengma");
let ture=document.querySelector(".ture");
let daojishi=document.querySelector(".daojishi");
let span=document.querySelector("span");
let phone=document.querySelector(".phone");
let yanzheng=document.querySelector(".yanzheng");
let password=document.querySelector(".password");
console.log(phone,yanzheng,password);
let num=60;
console.log(num);
yanzhengma.onclick=function () {
daojishi.style.display="block";
var t=setInterval(fn,1000);
function fn() {
num--;
if (num==-1){
//清除时间间隔函数
clearInterval(t);
daojishi.style.display="none";
num=60;
}
//改变span中的数字
span.innerHTML=num;
}
}
password.onblur=function () {
if (phone.value!=="" && password.value!=="" && yanzheng.value!==""){
ture.style.backgroundColor="#0ecf98";
}
}
ture.onclick=function () {
if (phone.value!="" && password.value!=""){
window.open("denglu.html");
}
}
</script>