File tree 2 files changed +18
-3
lines changed
2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change
1
+ // remove()
2
+ // removeChild()
3
+
4
+ const result = document . querySelector ( '.container' ) ;
5
+ // result.remove();
6
+
7
+ // here use removeChild()
8
+ const liRHP = result . querySelector ( 'h2' ) ;
9
+ result . removeChild ( liRHP ) ;
Original file line number Diff line number Diff line change @@ -125,11 +125,16 @@ <h2 class="third">third element</h2> -->
125
125
<h2 class="shp">The Pirates of SHP</h2>
126
126
</div> -->
127
127
128
- <!-- innerText -->
128
+ <!-- innerText prepend
129
129
<div class="container">
130
130
<h2 class="shp">The Pirates of SHP</h2>
131
- </ div >
131
+ </div> -->
132
132
133
+ <!-- remove , removeChild -->
134
+ < h2 > Hello World</ h2 >
135
+ < div class ="container ">
136
+ < h2 > On container</ h2 >
137
+ </ div >
133
138
<!-- source js -->
134
139
<!-- <script src="/01_getElementById.js"></script> -->
135
140
<!-- <script src="/02_getElementByTagName.js"></script> -->
@@ -144,6 +149,7 @@ <h2 class="shp">The Pirates of SHP</h2>
144
149
<!-- <script src="/11_className-classList.js"></script> -->
145
150
<!-- <script src="/12_createElement_textnode_appendChild.js"></script> -->
146
151
<!-- <script src="/13_insertBefore.js"></script> -->
147
- < script src ="/14_innerText_prepend.js "> </ script >
152
+ <!-- <script src="/14_innerText_prepend.js"></script> -->
475B
td>
153
+ < script src ="/15_remove_removeChild.js "> </ script >
148
154
</ body >
149
155
</ html >
You can’t perform that action at this time.
0 commit comments