I would like to add the li element after another li inside the ul element using javascript. This is the code that I still have.
var parentGuest = document.getElementById("one"); var childGuest = document.createElement("li"); childGuest.id = "two";
I am familiar with appendChild,
parentGuest.appendChild(childGuest);
However, this adds a new element inside another, not after. How to add a new item after an existing one? Thank.
<ul> <li id="one"></li> </ul>
javascript createelement getelementbyid appendchild
Wez Aug 31 '11 at 2:09 a.m. 2011-08-31 14:09
source share