nodevalue 属性用于获取节点值。您需要指定节点。
示例您可以尝试运行以下代码来了解如何获取nodevalue属性。
直播演示
<!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>
以上就是javascript html dom中的nodevalue属性是什么意思?的详细内容。