标签:code round charset http val lang pat utf-8 class
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>节点值nodeValue</title> <!-- node.nodeValue;获取node节点的值 --> </head> <body> <span>我是节点里面的值</span> <script> var span=document.getElementsByTagName("span")[0]; var a=span.firstChild;//获取span节点内的第一个子节点 console.log(a.nodeValue);//获取a节点的值 </script> </body> </html>
标签:code round charset http val lang pat utf-8 class
原文地址:https://www.cnblogs.com/vinson-blog/p/12112738.html