Javascript examples for DOM:Element nodeName
Element nodeName Property - Get the node name of the <body> element:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {// w w w .j a v a2 s. co m var x = document.body.nodeName; document.getElementById("demo").innerHTML = x; } </script> </body> </html>