-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDomAccessClass.html
More file actions
35 lines (27 loc) · 847 Bytes
/
Copy pathDomAccessClass.html
File metadata and controls
35 lines (27 loc) · 847 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
<html>
<head>
<title>Dom manipultion class</title>
<h1>DOM MANIPULTION IN CLASS</h1>
<script type="text/javascript">
function func1(){
var element = document.getElementsByClassName("myset")
for(var x=0;x<element.length;x++)
{
element[x].style.color =" red"
element[x].style.fontSize =35
}
}
</script>
</head>
<body>
<p class="myset">this is para 1</p>
<p>this is para 2</p>
<p class="myset">this is para 3</p>
<p>this is para 4</p>
<p class="myset">this is para 5</p>
<a href="#" class="myset">this is an anchor tag</a>
<br>
<br>
<button onclick="func1()">CLICK ME</button>
</body>
</html>