💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# childNodes 访问子节点 ~~~ <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>DOM-obj</title> </head> <body> <ul> <li></li> <li></li> <li></li> </ul> <script> childNode = document.getElementsByTagName('ul')[0].childNodes; console.log(childNode.length); // 3 console.log(childNode[1].nodeType); // 1 </script> </body> </html> ~~~