#The nodeValue property is used to get the node value. You need to specify the node.
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>
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!