parentNode.insertBefore(newChild, refChild)
Inserts node newChild as a child of parentNode before an existing child of node refChild. (Returns newChild.)
If refChild is null, newChild is added at the end of the list of children. Equivalent and more readable, use parentNode.appendChild (newChild).
Varun Bhatia May 14 '14 at 4:36 a.m. 2014-05-14 04:36
source share