Does the 1-node access relationship exist as an attribute? box1.nextelementsibling Get the next sibling node of Box1; Box1.parentNode.childNodes Get all sub-nodes Box1.parentNode.children Get all child nodes Box1.parentNode.firstElementChild Check the operation of your 2 node? Create node: Var & NBSP;AAA = document.createelement (' li '); Add node: Box1.appendchild (AAA); box1.insertbefore (BBB,AAA);   ; box1.insertafter (); Delete node: Box1.removechild (AAA); nbsp aaa.parentnode.removechild (AAA); //Delete yourself Replace node: box1.replacechild (Aaa,targetnode); 3 two ways to set or get element nodes? & nbsp; var Elenode = Document.getelmentSbytagname (' img ') [0]; //Set value ELENODE.SRC = ' images/tm.png '; elenode.bbb = ' Huihua ' ; Elenode.setattribute (' id ', ' dog '); elenode.setattribute (' CCC ', ' Huihua '); //Get values Console.log (elenode.tagname); Console.log (elenode.getattribute (' id ')); //delete values Elenode.removeattribute (' id ');
Using JS to manipulate ELEMENT nodes