Run ❯
Get your
own
website
❯
Run Code
Ctrl+Alt+R
Save Code
Ctrl+Alt+A
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Go to Spaces
Ctrl+Alt+P
<!DOCTYPE html> <html> <body> <h1>The Element Object</h1> <h2>The nodeName, nodetype, and nodeValue Properties</h2> <div id="myDIV">This is "myDIV".</div> <p>Node name, type and value of "myDIV"s first child is:</p> <p id="demo"></p> <script> const x = document.getElementById("myDIV").firstChild; let text = ""; text += "Name: " + x.nodeName + "<br>"; text += "Value: " + x.nodeValue + "<br>"; text += "Type: " + x.nodeType; document.getElementById("demo").innerHTML = text; </script> </body> </html>