Document.links
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2018ë 6ì.
links ìì±ì document ë´ìì href attribute 를 ê°ì§ë 모ë <area> ê³¼ <a> element ë¤ì collection ì ë°ííë¤.
Syntax
js
nodeList = document.links;
Example
js
var links = document.links;
for (var i = 0; i < links.length; i++) {
var linkHref = document.createTextNode(links[i].href);
var lineBreak = document.createElement("br");
document.body.appendChild(linkHref);
document.body.appendChild(lineBreak);
}
ëª ì¸ì
| Specification |
|---|
| HTML > # dom-document-links-dev > |