<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>DOM children方法</title> </head> <body> <div id="div1"> <p id="pid">p标签</p> </div> <script type="text/javascript"> var div1=document.getElementById("div1"); var first=div1.children[0]; console.log("first.nodeName="+first.nodeName);//first.nodeName=P console.log("first.innerHTML="+first.innerHTML);//first.innerHTML=p标签 </script> </body> </html>