A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/zh-CN/docs/Web/API/HTMLAllCollection/item below:

HTMLAllCollection:item() 方法 - Web API

HTMLAllCollection:item() 方法

HTMLAllCollection 接口的 item() 方法返回位于集合中指定偏移位置的元素,或其 id 或 name 属性具有指定值的元素。

语法 参数
nameOrIndex

如果参数是一个整数,或者是一个可以转换为整数的字符串,它表示将要返回的 Element 的位置。元素在 HTMLAllCollection 中出现的顺序与它们在文档源中出现的顺序相同。如果参数是一个无法转换为整数的字符串,它将被解释为将要返回的元素的 name 或 id。

返回值

如果 nameOrIndex 表示一个索引,item() 方法将返回位于指定索引处的 Element,如果 nameOrIndex 小于零或大于等于集合的长度属性,则返回 null。如果 nameOrIndex 表示一个名称,item() 方法将返回与 namedItem() 方法相同的值。

规范 浏览器兼容性 参见

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4