parentNodeinsertBeforenewNode
ParentNode.insertBefore(newNode, referenceNode) is a standard DOM method used to insert a node into a parent node’s children, placing newNode immediately before referenceNode.
Syntax and parameters: The method is invoked on a node that will serve as the parent (parentNode).
Behavior and rules: If newNode already has a different parent, it is removed from that parent and
Return value: The method returns the node that was inserted (or, in the case of a DocumentFragment,
Browser compatibility: This method is supported by all major browsers and is part of the standard DOM
Common usage: It is often used to reorder elements, insert newly created nodes into a specific position,