-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDOM.html
More file actions
44 lines (38 loc) · 1.15 KB
/
DOM.html
File metadata and controls
44 lines (38 loc) · 1.15 KB
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
40
41
42
43
44
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DOM</title>
<style>
.bg-black{
background-color: rgb(37, 36, 36);
color: #fff;
font-family: 'Times New Roman', Times, serif;
}
</style>
</head>
<body class="bg-black">
<div >
<h1 id="title" class="heading">DOM learning on Chai Or Code <span style="display: none;"> test text</span>
</h1>
<p>Lorem ipsum dolor sit amet consectetur.</p>
<input type="password" name="password" id="password">
</div>
<ul>
<li class="list-item">one</li>
<li class="list-item">two</li>
<li class="list-item">three</li>
<li class="list-item">four</li>
<!-- // converting this html collection list into array -->
</ul>
<script>
const tempLi=document.getElementsByClassName('list-item')
console.log( Array.from(tempLi)); //converting this html collection list into array
const myConvertedArr=Array.from(tempLi)
myConvertedArr.forEach(function(li){
li.style.color ="Orange"
})
</script>
</body>
</html>