175
rated 0 times
[
178]
[
3]
/ answers: 1 / hits: 46018
/ 12 Years ago, sat, january 12, 2013, 12:00:00
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:
document.getElementById('queue').removeChild(
document.getElementById('queue').childNodes[0]
);
And this is my HTML:
<ol id=queue>
<li>Surprised Kitty (Original)<span class=nodisplay>0Bmhjf0rKe8</span></li></ol>
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 been clear.
More From » element