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/selection/tostring | |
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/selection/tostring')
-rw-r--r-- | files/ru/web/api/selection/tostring/index.html | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/files/ru/web/api/selection/tostring/index.html b/files/ru/web/api/selection/tostring/index.html new file mode 100644 index 0000000000..9726f381b9 --- /dev/null +++ b/files/ru/web/api/selection/tostring/index.html @@ -0,0 +1,66 @@ +--- +title: Selection.toString() +slug: Web/API/Selection/toString +translation_of: Web/API/Selection/toString +--- +<div> +<div> +<div>{{ ApiRef("DOM") }}{{SeeCompatTable}}</div> +</div> +</div> + +<p>Метод <strong><code>Selection.toString()</code></strong> возвращает строку, содержащуюся в выделенном объекте, т.е. выделенный текст.</p> + +<h2 id="Syntax" name="Syntax">Syntax</h2> + +<pre class="syntaxbox"><em>str</em> =<em> sel</em>.toString() +</pre> + +<h3 id="Return_value">Return value</h3> + +<ul> + <li><em><code>str</code></em> -- это строка, содержащаяся в выделении.</li> +</ul> + +<h3 id="Parameters" name="Parameters">Parameters</h3> + +<p><em>None (отсутствуют).</em></p> + +<h2 id="Description" name="Description">Description</h2> + +<p>Этото метод возвращает выделенный текст.</p> + +<p>В <a href="en/JavaScript">JavaScript</a>, этот метод вызывается автоматически, когда функция, которой он передается, требует строку:</p> + +<pre class="brush: js">alert(window.getSelection()) // What is called +alert(window.getSelection().toString()) // What is actually being effectively called. +</pre> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('HTML Editing', '#dom-selection-stringifier', 'Selection.toString()')}}</td> + <td>{{Spec2('HTML Editing')}}</td> + <td>Initial definition</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">Browser compatibility</h2> + + + +<p>{{Compat("api.Selection.toString")}}</p> + +<h2 id="See_also" name="See_also">See also</h2> + +<ul> + <li>{{domxref("Selection")}}, the interface it belongs to.</li> +</ul> |