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/globaleventhandlers/onselect | |
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/globaleventhandlers/onselect')
-rw-r--r-- | files/ja/web/api/globaleventhandlers/onselect/index.html | 81 |
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"><!DOCTYPE html> +<html lang="ja"> +<head> +<meta charset="UTF-8" /> +<title>onselect のテスト</title> + +<style> +.text1 { border: 2px solid red; } +</style> + +<script> +window.onselect = selectText; + +function selectText() { + alert("select イベントが発生しました。"); +} +</script> +</head> + +<body> +<textarea class="text1" cols="30" rows="3"> +マウスでこのテキストを選択状態にすると +onselect イベントが発生し、 +アラートを表示する関数が実行されます。 +</textarea> +</body> +</html> +</pre> + +<h2 id="Notes" name="Notes">注記</h2> + +<p><code>select</code> イベントは、テキストインプット (<code><input type="text"></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> |