-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDomManForLoop.html
More file actions
32 lines (28 loc) · 843 Bytes
/
Copy pathDomManForLoop.html
File metadata and controls
32 lines (28 loc) · 843 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
<html>
<head>
<title>Dom MANI FOR loop</title>
<h1>DOM MANIPULATION BY FOR LOOP</h1>
<script type="text/javascript">
function func1()
{
var para = document.getElementsByTagName("p")
//in this functon all elements are put in to the for loop and addding styles at once
for(var i=0;i<para.length;i++)
{
para[i].style.color = "blue"
para[i].style.fontSize =25
}
}
</script>
</head>
<body>
<p>this is para 1</p>
<p>this is para 2</p>
<p>this is para 3</p>
<p>this is para 4</p>
<p>this is para 5</p>
<br>
<br>
<button onclick="func1()">CLICK ME</button>
</body>
</html>