Home > Web Front-end > HTML Tutorial > What does nodeValue attribute in JavaScript HTML DOM mean?

What does nodeValue attribute in JavaScript HTML DOM mean?

WBOY
Release: 2023-09-23 09:53:04
forward
1477 people have browsed it

JavaScript HTML DOM中的nodeValue属性是什么意思?

#The nodeValue property is used to get the node value. You need to specify the node.

Example

You can try running the following code to understand how to get the nodeValue property.

Live Demo

<!DOCTYPE html>
<html>
   <body>
      <p>Get the node value</p>
      <button>Demo Button Text</button>
      <script>
         var val = document.getElementsByTagName("BUTTON")[0];
         var res = val.childNodes[0].nodeValue;
         document.write("<br>Node Value: "+res);
      </script>
   </body>
</html>
Copy after login

The above is the detailed content of What does nodeValue attribute in JavaScript HTML DOM mean?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template