-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2nd.html
More file actions
31 lines (26 loc) · 807 Bytes
/
2nd.html
File metadata and controls
31 lines (26 loc) · 807 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Async Javascript with Two Projects</title>
</head>
<body>
<h1 id="name">M Talha Makhdoom</h1>
<button id="start">start</button>
<button id="stop">stop</button>
</body>
<script>
// console.log("is js working");
// setInterval(() => {
// console.log("waseem akram", Date.now());
// }, 1000);
const sayDate = function (str) {
console.log(str, Date.now()); //you can use default value also just like i passed it as parameter str whcih value is hi
};
const stopInterval = setInterval(sayDate, 1000, "hi");
document.getElementById("stop").addEventListener("click", () => {
clearInterval(stopInterval);
});
</script>
</html>