-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
56 lines (52 loc) · 1.79 KB
/
index.html
File metadata and controls
56 lines (52 loc) · 1.79 KB
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
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>awq</title>
</head>
<html>
<body>
<script>
var pressed = false;
function update()
{
if (pressed != true)
{
var today = new Date();
var finalday = new Date();
finalday.setFullYear(2023/12/16);
var hour = today.getHours();
var minute = today.getMinutes();
var second = today.getSeconds();
var text = hour + " " + minute + " " + second;
document.getElementById('demo').innerHTML = text;
setTimeout("update()", 1000);
}
}
update();
function myfunction()
{
var name = document.forms['myform']['name'].value;
var age = document.forms['myform']['age'].value;
if (name.length < 5 || age.length < 5)
{
document.getElementById('demo').innerHTML = "Error";
console.log(name);
}
else
{
document.getElementById('demo').innerHTML = "OK";
}
}
</script>
<p id="demo">
oo
</p>
<form name="myform" action="welcome.php" method="post" id="theform">
<p>Name:<input type="text" name="name" onkeyup="myfunction()"></p>
<p>Age:<input type="text" name="age" onkeyup="myfunction()"></p>
<p><input type="submit" value="提交"></p>
</form>
<button onclick="update()">点我</button>
<button onclick="update()">点我</button>
</body>
</html>