0% found this document useful (0 votes)
18 views4 pages

Class

Class

Uploaded by

bchavle0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views4 pages

Class

Class

Uploaded by

bchavle0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

<!

DOCTYPE html>
<head>
</head>
<body>
<script>
func on show()
{
document.getElementById("p1").innerHTML="welcome to css";
}
func on display()
{
document.write("hello");
}
</script>
<p id="p1"></p>
<p id="p2"></p>
<input type="bu on" value="setTimeout" onclick="setTimeout(show,1000)">
<br>
<br>
<input type="bu on" value="setInterval" onclick="setInterval(display,1000)">
</body>
</html>
Output:
clearTimeout:
<!DOCTYPE html>
<head>
</head>
<body>
<script>
func on display()
{
document.getElementById("p2").innerHTML="hello";
}

</script>
<p id="p2"></p>
<input type="bu on" value="strat" onclick=" setTimeout(display,1000);">
<input type="bu on" value="stop" onclick="clearTimeout(a);">
</body>
</html>

Output:
clearInterval:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF‐8">
<meta name="viewport" content="width=device‐width, ini al‐scale=1.0">
< tle>Document</ tle>
</head>
<body>
<script>

func on display()
{
const a=new Date();
document.getElementById("p2").innerHTML=a.toLocaleTimeString();
}

</script>
<p id="p2"></p>
<input type="bu on" value="strat" onclick=" setInterval(display,1000);">
<input type="bu on" value="stop" onclick="clearInterval(a);">
</body>
</html>
Outpu:

You might also like