javascript html insert element at beginning code example
Example 1: js insertbefore
// The Node.insertBefore() method inserts a node before a
// reference node as a child of a specified parent node.
let insertedNode = parentNode.insertBefore(newNode, referenceNode)
Example 2: javascript append how first element
var eElement; // some E DOM instance
var newFirstElement; //element which should be first in E
eElement.insertBefore(newFirstElement, eElement.firstChild);