html的DOM中document对象anchors集合用法实例
本文实例讲述了html的DOM中document对象anchors集合用法。分享给大家供大家参考。具体分析如下:
anchors集合可返回对文档中所有Anchor对象的引用。
语法:
document.anchors[]
例子:
<html> <body> <aname="first">Firstanchor</a><br/> <aname="second">Secondanchor</a><br/> <aname="third">Thirdanchor</a><br/> <br/> Numberofanchorsinthisdocument: <scripttype="text/javascript"> document.write(document.anchors.length) </script> </body> </html>
希望本文所述对大家的javascript程序设计有所帮助。
热门推荐
10 祝孙辈生日祝福语简短
11 恋人跨年祝福语大全简短
12 考大学敬酒简短祝福语
13 开工投产大吉祝福语 简短
14 偶然结婚祝福语朋友简短
15 感谢学长学姐祝福语简短
16 戏精的祝福语简短
17 我要结婚祝福语简短
18 婚前女儿生日祝福语简短