-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetIntervel3.html
More file actions
39 lines (35 loc) · 958 Bytes
/
Copy pathSetIntervel3.html
File metadata and controls
39 lines (35 loc) · 958 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
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
#divcls {
background: blue;
height: 200px;
width:300px;
border-radius: 15px;
padding:20px;
font-size:22px;
color:#fff;
}
</style>
</head>
<body>
<h1>Set Interval demo</h1>
<div id="divcls"></div>
<script>
window.setInterval(function(){myFunction()},10);
function myFunction()
{
if(document.getElementById("divcls").style.backgroundColor=='blue'){
document.getElementById("divcls").style.backgroundColor='red';
}
else{
document.getElementById("divcls").style.backgroundColor='blue';
}
}
</script>
</body>
</html>