FND / uitil

a tiny collection of JavaScript utility functions
6 stars 0 forks source link

Add a function to remove a node from the DOM #1

Closed moonglum closed 7 years ago

moonglum commented 7 years ago

Removing a node from the DOM is quite awkward with the native DOM API. Imagine you want to remove the parent of this from the DOM, you have to write:

this.parentNode.parentNode.removeChild(this.parentNode)

This is hard to parse. Instead I want to be able to write:

removeChild(this.parentNode)

I think this fits the philosophy of this project 😄

FND commented 7 years ago

:+1: Thank you!