-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
50 lines (36 loc) · 1.25 KB
/
script.js
File metadata and controls
50 lines (36 loc) · 1.25 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
45
46
47
48
49
50
// //Dom means document object model
// // console.log(window);
// console.log(document.body);
// DOM
const title = document.getElementById("title")
// title.style.backgroundColor = "green"
// title.style.height = "100px"
// title.style.padding = "10px"
// title.style.borderRadius = "10px"
// const a = title.innerHTML
// const b = title.innerText
// const c = title.textContent
// console.log(a);
// console.log(b);
// console.log(c);
//Dom Create new element
const parent = document.querySelector(".parent");
// console.log(parent.children[0].innerHTML);
// for (i = 0; i < parent.children.length; i++) {
// console.log(parent.children[i].innerHTML);
// }
// parent.children[1].style.color = "orange";
// console.log(parent.firstElementChild);
// console.log(parent.lastElementChild);
// const days = document.querySelector(".day");
// console.log(days.parentElement);
// console.log(days.nextElementSibling);
// console.log("NODES: " , parent.childNodes);
// const div = document.createElement("h1");
// div.className = "main"
// div.id = Math.round(Math.random() * 10 + 1)
// div.setAttribute("title", "kaif")
// // div.innerText = "practice DOM"
// const addText = document.createTextNode("parctice DOM");
// div.appendChild(addText)
// console.log(div);