Skip to content

Commit c6f5f7b

Browse files
authored
Add files via upload
update javascript code
1 parent accacb7 commit c6f5f7b

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

jquery/W3C/other/index26.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Title</title>
6+
<script type="text/javascript">
7+
var num = 0, i;
8+
function timedCount() {
9+
document.getElementById('txt').value = num;
10+
num = num + 1;
11+
i = setTimeout(timedCount, 1000);
12+
}
13+
setTimeout(timedCount, 1000);
14+
function stopCount() {
15+
clearTimeout(i);
16+
}
17+
</script>
18+
</head>
19+
<body>
20+
<form>
21+
<input type="text" id="txt">
22+
<input type="button" value="Stop" onclick="stopCount()">
23+
</form>
24+
</body>
25+
</html>

jquery/W3C/other/index27.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
5+
<title>Title</title>
6+
</head>
7+
<body>
8+
<h1>操作成功</h1>
9+
<span id="second">5</span>
10+
<span>秒后返回到主页面</span>
11+
<a href="javascript:back();">返回</a>
12+
13+
<script type="text/javascript">
14+
var num = document.getElementById("second").innerHTML;
15+
function count() {
16+
num--;
17+
document.getElementById("second").innerHTML = num;
18+
if (num == 0) {
19+
location.assign("https://www.baidu.com");
20+
}
21+
}
22+
setInterval("count()", 1000);
23+
function back() {
24+
window.history.back();
25+
}
26+
</script>
27+
28+
</body>
29+
</html>

0 commit comments

Comments
 (0)