var header1 = document.getElementById("header");
var p = document.createElement("p"); // Create an element node
insertAfter(p, header1); // Because js does not have a method to directly append to the specified element, you have to create a method yourself
function insertAfter( newElement, targetElement ){ // newElement is the element to be appended targetElement is the position of the specified element
var parent = targetElement.parentNode; // Find the parent node of the specified element
if( parent.lastChild == targetElement ){ // Determine whether the specified element is the last position in the node. If so, use the appendChild method directly
parent.appendChild( newElement, targetElement );
}else{
parent.insertBefore( newElement, targetElement.nextSibling );
};
};