Skip to content

Commit 777a043

Browse files
committed
setInterval & setTimeOut in Javascript
1 parent cdd1c44 commit 777a043

File tree

5 files changed

+31
-98
lines changed

5 files changed

+31
-98
lines changed

Custom Utility Kit/ContactPage/index.html

-27
This file was deleted.

Custom Utility Kit/ContactPage/script.js

-15
This file was deleted.

Custom Utility Kit/ContactPage/style.css

-56
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>setInterval & setTimeOut</title>
8+
</head>
9+
<body>
10+
<div>
11+
Time now is <span id="time"></span>
12+
</div>
13+
<script src="script.js"></script>
14+
</body>
15+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// function greet(){
2+
// console.log('Hello World');
3+
// }
4+
5+
// timeoutID= setTimeout(greet, 5000);
6+
// clearTimeout(timeoutID);
7+
8+
// intervalID=setInterval(greet, 2000);
9+
// clearInterval(intervalID);
10+
11+
function displayTime(){
12+
time = new Date();
13+
console.log(time);
14+
document.getElementById('time').innerHTML = time;
15+
}
16+
setInterval(displayTime, 1000);

0 commit comments

Comments
 (0)