<UL ID="myul1"><LI>Coffee</LI><LI>Tea</LI></UL> <UL ID="myul2"><LI>Water</LI><LI>Milk</LI></UL> <SCRIPT TYPE="text/javascript"> function foo() { var node = document.getElementById("myul2").lastChild; document.getElementById("myul1").appendChild(node); } </SCRIPT> <BUTTON ONCLICK="foo()">Klik</BUTTON>
Coba jalankan demo di bawah ini:
Coffee
Tea
Water
Milk
Demikian yang dapat kami share kepada sobat source code aplikasi pada kesempatan ini, semoga dapat bermanfaat dan bisa menjadi referensi pemrograman bagi anda. Jangan lupa like Fan Page kami, dan SUBSCRIBE Channel Youtube kami untuk dapatkan update source code aplikasi terbaru.
Properti Node.attributes (Core Level 1) mengembalikan semua atribut dari Node ini sebagai objek NamedNodeMap. Sintaks: Node.attributes Properti Node.attributes di dukung...
Properti Node.baseURI (Core Level 3) mengembalikan DOMString yang mengatakan absolute base URI dari Node. Sintaks: Node.baseURI Properti Node.baseURI di dukung...
Properti Node.childNodes (Core Level 1) mengembalikan semua child node dari Node ini sebagai objek NodeList. Sintaks: Node.childNodes Properti Node.childNodes di...