From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- files/ru/web/api/document/links/index.html | 72 ++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 files/ru/web/api/document/links/index.html (limited to 'files/ru/web/api/document/links') diff --git a/files/ru/web/api/document/links/index.html b/files/ru/web/api/document/links/index.html new file mode 100644 index 0000000000..3497a83b47 --- /dev/null +++ b/files/ru/web/api/document/links/index.html @@ -0,0 +1,72 @@ +--- +title: Document.links +slug: Web/API/Document/links +tags: + - API + - Document + - HTML DOM + - Property + - Reference +translation_of: Web/API/Document/links +--- +

{{ APIRef("DOM") }}

+ +

Возвращает объект всех элементов {{HTMLElement("area")}} и {{HTMLElement("a")}}, присутствующих на странице с значением атрибута href.

+ +

Синтаксис

+ +
nodeList = document.links
+
+ +

 

+ +

Значение

+ +

{{domxref("HTMLCollection")}}.

+ +

 

+ +

Пример

+ +
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);
+}
+
+ +

Спецификации

+ + + + + + + + + + + + + + + + + + + +
СпецификацияСтатусКомментарий
{{SpecName('HTML WHATWG', '#dom-document-links', 'Document.links')}}{{ Spec2('HTML WHATWG') }} 
{{SpecName("DOM2 HTML", "html.html#ID-7068919", "document.links")}}{{Spec2("DOM2 HTML")}}Исходное определение.
+ +

Совместимость с браузерами

+ +

 

+ + + +

{{Compat("api.Document.links")}}

+ +

 

-- cgit v1.2.3-54-g00ecf