-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfun.html
63 lines (59 loc) · 1.33 KB
/
fun.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
<html><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
<title>问题</title>
<style>
body{
width: 100%;
height: 100vh;
overflow: auto;
}
div{
width: 62%;
margin-top: 40%;
margin: auto;
}
div button{
background-color:#FFC0CB;
width: 80px;
height: 50px;
font-size: 20px;
color: white;
}
h1{
font-size: 1.5rem;
color:aquamarine;
}
p{
font-size: 0.8rem;
}
</style>
</head>
<body>
<div>
<h1>你是不是我的小可爱???</h1>
<p id="p"></p>
<button id="yes">是</button>
<button id="no">不是</button>
</div>
<script>
window.onload=function(){
var yes=document.getElementById("yes");
var no=document.getElementById("no");
var p=document.getElementById("p");
yes.onclick=function(){
alert("哈哈哈!!!这才乖,你是我的小可爱");
}
var z=new Array("怎么?不承认?","承认了吧,没人笑你","快承认了吧","哼,那我消失了","不承认,真消失了","消失,看你承不承认,哼");
var i=0
no.onclick=function(){
p.innerHTML +=z[i]+"<br>";
if(i>4){
this.style.display="none";
}else{
i++;
}
}
}
</script>
</body></html>