File tree 2 files changed +8
-6
lines changed
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -10,3 +10,5 @@ console.log(useChildNodes.childNodes[0].nodeValue);
10
10
// but for efisien use textContent
11
11
const useTextContent = document . querySelector ( 'h2' ) ;
12
12
console . log ( useTextContent . textContent ) ;
13
+ // here textContent can change element h2 too
14
+ useTextContent . textContent = 'Change Text Content h2' ;
Original file line number Diff line number Diff line change @@ -86,9 +86,9 @@ <h2>The Pirates</h2>
86
86
<li>marine ford</li>
87
87
</ul> -->
88
88
89
- <!-- textContent and childNodes
89
+ <!-- textContent and childNodes -->
90
90
< h3 > Hello people</ h3 >
91
- <h2>Hello World</h2> -->
91
+ < h2 > Hello World</ h2 >
92
92
93
93
<!-- getAttribute, setAttribute
94
94
<div class="container">
@@ -100,10 +100,10 @@ <h2 class="title" id="titles">Hello World</h2>
100
100
</p>
101
101
</div> -->
102
102
103
- <!-- className & classList -->
103
+ <!-- className & classList
104
104
<h2 class="first">first element</h2>
105
105
<h2 class="second">second element</h2>
106
- < h2 class ="third "> third element</ h2 >
106
+ <h2 class="third">third element</h2> -->
107
107
108
108
<!-- source js -->
109
109
<!-- <script src="/01_getElementById.js"></script> -->
@@ -114,8 +114,8 @@ <h2 class="third">third element</h2>
114
114
<!-- <script src="/06_parentElement.js"></script> -->
115
115
<!-- <script src="/07_nextSibling_previous.js"></script> -->
116
116
<!-- <script src="/08_nextElementSibling_previous.js"></script> -->
117
- <!-- < script src="/09_textContent.js"></script> -- >
117
+ < script src ="/09_textContent.js "> </ script >
118
118
<!-- <script src="/10_getAttribute.js"></script> -->
119
- < script src ="/11_className-classList.js "> </ script >
119
+ <!-- < script src="/11_className-classList.js"></script> -- >
120
120
</ body >
121
121
</ html >
You can’t perform that action at this time.
0 commit comments