Skip to content

Commit 7f82589

Browse files
DOM
1 parent 80a77ce commit 7f82589

3 files changed

Lines changed: 37 additions & 1 deletion

File tree

Dom.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// const title_elements = document.querySelectorAll(".family");
2+
3+
// title_elements.forEach(element => {
4+
// console.log(element);
5+
// });
6+
7+
8+
// const allContacts = document.querySelectorAll('p')
9+
// console.log(allContacts)
10+
// allContacts.forEach(element => {
11+
// console.log(element)
12+
// });
13+
14+
const firstWorkContact = document.querySelectorAll('button')
15+
console.log(firstWorkContact)
16+
17+
const thirdBtn = document.querySelector('div button:nth-child(3)')
18+
console.log(thirdBtn)

new.html

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,22 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>Document</title>
7+
<style src="style.css"></style>
78
</head>
89
<body>
9-
<script src="function_test.js"></script>
10+
<h1 id="page-title">Phonebook</h1>
11+
12+
<p class="family">Marie</p>
13+
<p class="family">Jose</p>
14+
<p class="work">Anne</p>
15+
<p class="work">Joan</p>
16+
<div>
17+
<button>First button</button>
18+
<button>Second button</button>
19+
<button>Third button</button>
20+
<button>Fourth button</button>
21+
</div>
22+
<script src="Dom.js"></script>
1023
</body>
1124

1225

style.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
h1{
2+
background-color: blue;
3+
background-position: 0%;
4+
text-decoration: dashed;
5+
}

0 commit comments

Comments
 (0)