- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is nodeName property in JavaScript HTML DOM?
The nodeName property in JavaScript is used to specify the name of a node.
Example
You can try to run the following code to learn how to implement a nodeName property in JavaScript.
<!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>
Advertisements