I so miss jQuery. I\'m working on a project where I need to get my hands dirty with good \'ol plain Javascript again.
I have this scenario:
parent
Also when not iterating through children (just inserting after referenceNode) this might be useful:
referenceNode
parentNode.insertBefore(newNode, referenceNode.nextSibling);