aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/globaleventhandlers/onselect
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/globaleventhandlers/onselect
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/ja/web/api/globaleventhandlers/onselect')
-rw-r--r--files/ja/web/api/globaleventhandlers/onselect/index.html81
1 files changed, 81 insertions, 0 deletions
diff --git a/files/ja/web/api/globaleventhandlers/onselect/index.html b/files/ja/web/api/globaleventhandlers/onselect/index.html
new file mode 100644
index 0000000000..31ac15ff9c
--- /dev/null
+++ b/files/ja/web/api/globaleventhandlers/onselect/index.html
@@ -0,0 +1,81 @@
+---
+title: window.onselect
+slug: Web/API/GlobalEventHandlers/onselect
+tags:
+ - DOM
+ - Gecko
+ - Window
+translation_of: Web/API/GlobalEventHandlers/onselect
+---
+<div>{{ ApiRef("HTML DOM") }}</div>
+
+<p>{{domxref("window")}} の <code>select</code> イベントに対応するイベントハンドラです。</p>
+
+<h2 id="Syntax" name="Syntax">構文</h2>
+
+<pre class="syntaxbox">window.onselect = <em>funcRef</em>;
+</pre>
+
+<ul>
+ <li><code>funcRef</code> : 関数への参照、または関数式</li>
+</ul>
+
+<h2 id="Example" name="Example">例</h2>
+
+<pre class="brush: html">&lt;!DOCTYPE html&gt;
+&lt;html lang="ja"&gt;
+&lt;head&gt;
+&lt;meta charset="UTF-8" /&gt;
+&lt;title&gt;onselect のテスト&lt;/title&gt;
+
+&lt;style&gt;
+.text1 { border: 2px solid red; }
+&lt;/style&gt;
+
+&lt;script&gt;
+window.onselect = selectText;
+
+function selectText() {
+ alert("select イベントが発生しました。");
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body&gt;
+&lt;textarea class="text1" cols="30" rows="3"&gt;
+マウスでこのテキストを選択状態にすると
+onselect イベントが発生し、
+アラートを表示する関数が実行されます。
+&lt;/textarea&gt;
+&lt;/body&gt;
+&lt;/html&gt;
+</pre>
+
+<h2 id="Notes" name="Notes">注記</h2>
+
+<p><code>select</code> イベントは、テキストインプット (<code>&lt;input type="text"&gt;</code>) もしくは {{htmlelement("textarea")}} 要素のテキストが<em>選択された直後に</em> 発生します。</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','webappapis.html#handler-onselect','onselect')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_Compatibility" name="Browser_Compatibility">ブラウザー実装状況</h2>
+
+<div>
+
+
+<p>{{Compat("api.GlobalEventHandlers.onselect")}}</p>
+</div>