Skip to content

Tag: element

Remove first child in javascript

I’m trying to remove the first li in an ol using the DOM removeChild(). But for some reason it doesn’t work. This is my javascript: And this is my HTML: I tried alerting the childNodes[0], and it returns [Object Text], which seems a bit weird, when I was expecting just the object. Hope I’ve …