diff options
| author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:52 -0500 |
|---|---|---|
| committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:52 -0500 |
| commit | 074785cea106179cb3305637055ab0a009ca74f2 (patch) | |
| tree | e6ae371cccd642aa2b67f39752a2cdf1fd4eb040 /files/ru/web/api/document/head/index.html | |
| parent | da78a9e329e272dedb2400b79a3bdeebff387d47 (diff) | |
| download | translated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.gz translated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.bz2 translated-content-074785cea106179cb3305637055ab0a009ca74f2.zip | |
initial commit
Diffstat (limited to 'files/ru/web/api/document/head/index.html')
| -rw-r--r-- | files/ru/web/api/document/head/index.html | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/files/ru/web/api/document/head/index.html b/files/ru/web/api/document/head/index.html new file mode 100644 index 0000000000..8645de05b4 --- /dev/null +++ b/files/ru/web/api/document/head/index.html @@ -0,0 +1,87 @@ +--- +title: Document.head +slug: Web/API/Document/head +tags: + - API + - Document + - Property +translation_of: Web/API/Document/head +--- +<p>{{APIRef("DOM")}}</p> + +<p>Возвращает элемент {{HTMLElement("head")}} текущего документа. Если имеется более одного элемента <code><head></code>, будет возвращен первый из них.</p> + +<h2 id="Syntax" name="Syntax">Синтаксис</h2> + +<pre class="syntaxbox notranslate"><em>var objRef</em> = document.head; +</pre> + + + +<h3 id="Значение">Значение</h3> + +<p>{{domxref("HTMLHeadElement")}}.</p> + + + +<h2 id="Пример">Пример</h2> + +<pre class="notranslate"><code><!doctype html> +<head id="my-document-head"> + <title>Example: using document.head</title> +</head> + +<script> + var theHead = document.head; + + console.log(theHead.id); // "my-document-head"; + + console.log( theHead === document.querySelector("head") ); // true +</script></code></pre> + +<h2 id="Примечание">Примечание</h2> + +<p><code>document.head</code> доступно только для чтения. Присвоить значение этому свойству нельзя. При попытке это сделать ошибка вызвана не будет, только если вы не используете <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode">Strict Mode</a>. В данном случае будет вызвано {{jsxref("TypeError")}} .</p> + + + +<h2 id="Спецификации">Спецификации</h2> + +<table class="spectable standard-table"> + <tbody> + <tr> + <th scope="col">Спецификация</th> + <th scope="col">Статус</th> + <th scope="col">Комментарий</th> + </tr> + <tr> + <td>{{SpecName('HTML WHATWG','dom.html#dom-document-head','Document.head')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td>Начальное определение.</td> + </tr> + <tr> + <td>{{SpecName('HTML5.1','dom.html#dom-document-head','Document.head')}}</td> + <td>{{Spec2('HTML5.1')}}</td> + <td></td> + </tr> + <tr> + <td>{{SpecName('HTML5 W3C','dom.html#dom-document-head','Document.head')}}</td> + <td>{{Spec2('HTML5 W3C')}}</td> + <td></td> + </tr> + </tbody> +</table> + +<h2 id="Браузерная_поддержка">Браузерная поддержка</h2> + +<div class="hidden"> +<p>The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a>and send us a pull request.</p> +</div> + +<p>{{Compat("api.Document.head")}}</p> + +<h2 id="Смотрите_также">Смотрите также</h2> + +<ul> + <li>{{domxref("document.body")}}</li> +</ul> |
