@bouhm
Pretty nice article to glance all the frequently used Vanilla JS Snippets, thanks for writing this!
Just had one observation:
In the Updating/Replacing Elements section, I think you're trying to remove existing dom elements in the List, so I think the following should be the correct code to get existing list element:
// Get the existing list element
const list = document. querySelector('#list-container ul')
// Iterate through list's children and remove them all
while (list.firstChild)
list.firstChild.remove()
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
@bouhm Pretty nice article to glance all the frequently used Vanilla JS Snippets, thanks for writing this!
Just had one observation:
In the
Updating/Replacing Elementssection, I think you're trying to remove existing dom elements in the List, so I think the following should be the correct code to get existing list element: