Tutorials  "/> Tutorials  ">
Home >Web Front-end >HTML Tutorial >What is the nodeName attribute in JavaScript HTML DOM?
The nodeName attribute in JavaScript is used to specify the name of the node.
You can try running the following code to understand how to implement the nodeName property in JavaScript.
Real-time demonstration
<!DOCTYPE html> <html> <body> <h1 id="id1">Tutorials</h1> <p id="id2">Demo Content</p> <p id="id3"></p> <p id="id4"></p> <script> document.getElementById("id3").innerHTML = document.getElementById("id1").nodeName; document.getElementById("id4").innerHTML = document.getElementById("id2").nodeName; </script> </body> </html>
The above is the detailed content of What is the nodeName attribute in JavaScript HTML DOM?. For more information, please follow other related articles on the PHP Chinese website!