0

Can we remove the parent element?

Can we remove the parent element if we click the child element using JS code?

6th Apr 2021, 2:33 PM
Wai Lim
Wai Lim - avatar
5 ответов
+ 3
This is one very simple example. There are other ways as well. https://code.sololearn.com/WLwJr1U2pmi4/?ref=app
6th Apr 2021, 2:45 PM
Avinesh
Avinesh - avatar
6th Apr 2021, 4:17 PM
Avinesh
Avinesh - avatar
0
child.parentNode.removeChild(child)
6th Apr 2021, 2:46 PM
Илья Мирошник
Илья Мирошник - avatar
0
Can we leave the child here but remove the parent?
6th Apr 2021, 2:51 PM
Wai Lim
Wai Lim - avatar
0
Thank you very much!
6th Apr 2021, 6:08 PM
Wai Lim
Wai Lim - avatar