Javascript examples for DOM:Element item
Element item() Method - Use childNodes.item(index) to access child node
<!DOCTYPE html> <html> <body><p>This is the first p element in body.</p> <button onclick="myFunction()">Test</button> <script> function myFunction() {//w w w . ja v a2 s . c o m document.body.childNodes.item(0).innerHTML = "Changed!"; } </script> </body> </html>