Baseline Widely available
HTMLCollection
ã® item()
ã¡ã½ããã¯ããã®éåã®ä¸ã§æå®ãããä½ç½®ã«ãããã¼ããè¿ãã¾ãã
ã¡ã¢: HTMLCollection
ã®ä¸èº«ã¯ã©ã¤ãã§ããããããã®èæ¯ã«ãã DOM ãå¤åããã¨ãåã®éåå
ã«ããåã
ã®ãã¼ãã®ä½ç½®ã¯å¤åããå¯è½æ§ããããã¤ã³ããã¯ã¹å¤ãæå®ããããã¼ããå·®ãç¶ããªããªãå¯è½æ§ãããã¾ãã
index
è¿ã Node
ã®ä½ç½®ãè¦ç´ 㯠HTMLCollection
å
ã§ãææ¸å
ã®ã½ã¼ã¹ã«ç¾ããé åºã¨åãé åºã§ç¾ãã¾ãã
æå®ããã¤ã³ããã¯ã¹ã«ãã Node
ãã¾ã㯠index
ã 0 ããå°ããã length ããããã£ä»¥ä¸ã®å ´å㯠null
ã§ãã
item()
ã¡ã½ãã㯠HTMLCollection
ããçªå·ä»ããããè¦ç´ ãè¿ãã¾ããJavaScript ã§ HTMLCollection
ãé
åã¨ãã¦æ±ããé
åè¨æ³ã使ç¨ãã¦ã¤ã³ããã¯ã¹ã使ããæ¹ãç°¡åã§ããä¸è¨ã®ä¾ãåç
§ãã¦ãã ããã
const images = document.images; // ãã㯠HTMLCollection
const img0 = images.item(0); // ãã®ããã« item() ã¡ã½ããã使ããã¨ãã§ãã
const img1 = images[1]; // ãã ãããã®è¨è¿°æ¹ãããæããä¸è¬ç
ãã©ã¦ã¶ã¼ã®äºææ§ é¢é£æ
å ±
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