Baseline Widely available
HTMLCollection.item()
ç±ä½ç½®è·åå
ç´ ã
æ³è¦è¢«è¿åç Node çä½ç½®ãå ç´ å¨ HTML Collection ä¸ç顺åºåä»ä»¬å¨æºææ¡£ç顺åºä¿æä¸è´ã
æå®ç index çNode
, 妿 index å°äº 0 æè
ä¸å°äºå®çé¿åº¦å±æ§åè¿å nullã
HTMLCollection ä¸ item()
æ¹æ³è¿åä¸ä¸ªç¼å·çå
ç´ ï¼å¨ JavaScript 䏿 HTMLCollection 彿æ¯ä¸ä¸ªæ¯æ°ç»å¹¶ç¨æ°ç»ç¬¦å·å»ç´¢å¼ååç®åã
var c = document.images; // This is an HTMLCollection
var img0 = c.item(0); // You can use the item( ) method this way
var img1 = c[1]; // But this notation is easier and more common
See also
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