Javascript examples for DOM:Element item
Element item() Method - Use childNodes[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 va 2s . c o m*/ document.body.childNodes[0].innerHTML = "Changed!"; } </script> </body> </html>