内容 |
具体如下: 下面的JS代码通过document.archors数组获取第一个archor的innerHTML <!DOCTYPE html> <html> <body> <a name="html">ynpxrz.com</a><br> <a name="css">CSS Tutorial</a><br> <a name="xml">XML Tutorial</a> <p>innerHTML of the first anchor: <script> document.write(document.anchors[0].innerHTML); </script> </p> </body> </html> 上面的代码输出: ynpxrz.com |