diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/range/setstart/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/ja/web/api/range/setstart/index.html')
-rw-r--r-- | files/ja/web/api/range/setstart/index.html | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/files/ja/web/api/range/setstart/index.html b/files/ja/web/api/range/setstart/index.html new file mode 100644 index 0000000000..602b195c6b --- /dev/null +++ b/files/ja/web/api/range/setstart/index.html @@ -0,0 +1,112 @@ +--- +title: Range.setStart +slug: Web/API/Range/setStart +translation_of: Web/API/Range/setStart +--- +<p>{{ apiref("Range") }}</p> + +<p><strong><code>Range.setStart()</code></strong> メソッドは{{ domxref("Range") }}の開始位置を指定します。</p> + +<p><code>startNode</code> が <code>Text</code>, <code>Comment</code>, あるいは <code>CDATASection</code> タイプの {{ domxref("Node") }} であるとき、<code>startOffset</code>は<code>startNode</code>の開始位置からの文字数です。その他の<code>Node</code>タイプの場合、 <code>startOffset</code>は<code>startNode</code>からの子ノード数です。</p> + +<p>開始位置を終了位置よりも下(ドキュメントよりも下)に指定すると <code>ERROR_ILLEGAL_VALUE</code> {{domxref("DOMException")}} 例外が投げられます。</p> + +<h2 id="Syntax" name="Syntax">Syntax</h2> + +<pre class="syntaxbox notranslate"><em>range</em>.setStart(<em>startNode</em>, <em>startOffset</em>); +</pre> + +<h3 id="Parameters" name="Parameters">Parameters</h3> + +<dl> + <dt><em>startNode</em></dt> + <dd>{{ domxref("Range") }} を開始する {{ domxref("Node") }}</dd> + <dt><em>startOffset</em><code> </code></dt> + <dd>{{ domxref("Range") }}の開始位置を示す<code>startNode</code>オフセット(非負整数)</dd> +</dl> + +<h2 id="Example" name="Example">Example</h2> + +<pre class="brush: js notranslate">var range = document.createRange(); +var startNode = document.getElementsByTagName("p").item(2); +var startOffset = 0; +range.setStart(startNode,startOffset); +</pre> + +<h2 id="Specification" name="Specification">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('DOM WHATWG', '#dom-range-setstart', 'Range.setStart()')}}</td> + <td>{{Spec2('DOM WHATWG')}}</td> + <td>No change.</td> + </tr> + <tr> + <td>{{SpecName('DOM2 Traversal_Range', 'ranges.html#Level2-Range-method-setStart', 'Range.setStart()')}}</td> + <td>{{Spec2('DOM2 Traversal_Range')}}</td> + <td>Initial specification.</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + +<p>{{CompatibilityTable}}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatGeckoDesktop("1.0")}}</td> + <td>9.0</td> + <td>9.0</td> + <td>{{CompatVersionUnknown}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>Feature</th> + <th>Android</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + </tr> + <tr> + <td>Basic support</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatGeckoMobile("1.0")}}</td> + <td>9.0</td> + <td>9.0</td> + <td>{{CompatVersionUnknown}}</td> + </tr> + </tbody> +</table> +</div> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="/en-US/docs/DOM/DOM_Reference" title="/en-US/docs/DOM/DOM_Reference">The DOM interfaces index</a></li> +</ul> |