aboutsummaryrefslogtreecommitdiff
path: root/files/ru/web/api/document/body
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:52 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:52 -0500
commit074785cea106179cb3305637055ab0a009ca74f2 (patch)
treee6ae371cccd642aa2b67f39752a2cdf1fd4eb040 /files/ru/web/api/document/body
parentda78a9e329e272dedb2400b79a3bdeebff387d47 (diff)
downloadtranslated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.gz
translated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.bz2
translated-content-074785cea106179cb3305637055ab0a009ca74f2.zip
initial commit
Diffstat (limited to 'files/ru/web/api/document/body')
-rw-r--r--files/ru/web/api/document/body/index.html87
1 files changed, 87 insertions, 0 deletions
diff --git a/files/ru/web/api/document/body/index.html b/files/ru/web/api/document/body/index.html
new file mode 100644
index 0000000000..1a6be5d191
--- /dev/null
+++ b/files/ru/web/api/document/body/index.html
@@ -0,0 +1,87 @@
+---
+title: Document.body
+slug: Web/API/Document/body
+tags:
+ - API
+ - BODY
+ - Document
+ - frameset
+translation_of: Web/API/Document/body
+---
+<div>{{APIRef("DOM")}}</div>
+
+<p>Возвращает узел {{HTMLElement("body")}} или {{HTMLElement("frameset")}} текущей страницы, или <strong><code>null</code></strong> если таких элементов не существует.</p>
+
+<h2 id="Syntax" name="Syntax">Синтаксис</h2>
+
+<pre class="syntaxbox"><em>var objRef</em> = document.body;
+document.body = <em>objRef;</em></pre>
+
+<h2 id="Example" name="Example">Пример</h2>
+
+<pre class="brush:js">// в HTML: &lt;body id="oldBodyElement"&gt;&lt;/body&gt;
+alert(document.body.id); // "oldBodyElement"
+
+var aNewBodyElement = document.createElement("body");
+
+aNewBodyElement.id = "newBodyElement";
+document.body = aNewBodyElement;
+alert(document.body.id); // "newBodyElement"
+</pre>
+
+<h2 id="Notes" name="Notes">Примечания</h2>
+
+<p><strong><code>document.body</code></strong> это элемент, который включает в себя содержимое страницы. На страницах с <code>&lt;body&gt;</code> вернётся элемент <code>&lt;body&gt;</code>, а с frameset'ом - элемент <code>&lt;frameset&gt;</code>.</p>
+
+<p><strong><code>body</code></strong> может быть заменено, но это удалит все его дочерние элементы.</p>
+
+<h2 id="Specification" name="Specification">Спецификации</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-body','Document.body')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML5.1','dom.html#dom-document-body','Document.body')}}</td>
+ <td>{{Spec2('HTML5.1')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML5 W3C','dom.html#dom-document-body','Document.body')}}</td>
+ <td>{{Spec2('HTML5 W3C')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM2 HTML','html.html#ID-56360201','Document.body')}}</td>
+ <td>{{Spec2('DOM2 HTML')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM1','level-one-html.html#attribute-body','Document.body')}}</td>
+ <td>{{Spec2('DOM1')}}</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.body")}}</p>
+
+<h2 id="Смотрите_также">Смотрите также</h2>
+
+<ul>
+ <li>{{domxref("document.head")}}</li>
+</ul>