Today, when we learned about DOM node operations, we discovered an interesting phenomenon of the createelement () method for creating DOM nodes.
The code is as follows:
var Box=document.getelementbyid ("box");//Assume that there is already an element in the page with the ID box;
var Bbb=document.getelementbyid ("BBB");//Assume that there is already an element in the page with the ID box;
var aaa=document.createelement ("div");//Create a DIV element
Box.appendchild (AAA);//Insert a new node in the last face of the box element AAA; (at this point, AAA in the last Face of Box)
Box.insertbefore (AAA,BBB);//Insert a new node before the box element AAA; (at this point, AAA is in front of the BBB and disappears from the back of Box)
Box.appendchild (AAA);//Insert a new node in the last face of the box element AAA; (at this point, AAA is at the end of box and disappears from the front of box)
So I guess the elements created by the createelement () method are dynamic and unique,
No matter how many times you call an element that you create, the location of the element created by createelement () is determined by the node that was last called.
In this temporary record, we will leave it to further understanding.
The createelement () method of the HTML DOM object