aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/htmlelement/onpaste
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/htmlelement/onpaste
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/htmlelement/onpaste')
-rw-r--r--files/ja/web/api/htmlelement/onpaste/index.html86
1 files changed, 86 insertions, 0 deletions
diff --git a/files/ja/web/api/htmlelement/onpaste/index.html b/files/ja/web/api/htmlelement/onpaste/index.html
new file mode 100644
index 0000000000..71c5e05538
--- /dev/null
+++ b/files/ja/web/api/htmlelement/onpaste/index.html
@@ -0,0 +1,86 @@
+---
+title: HTMLElement.onpaste
+slug: Web/API/HTMLElement/onpaste
+tags:
+ - API
+ - API
+ - HTMLElement
+ - HTMLElement
+ - イベントハンドラー
+ - イベントハンドラー
+ - プロパティ
+ - プロパティ
+ - リファレンス
+ - 標準外
+translation_of: Web/API/HTMLElement/onpaste
+---
+<div>{{ APIRef("HTML DOM") }} {{Non-standard_header}}</div>
+
+<p><strong>onpaste</strong> プロパティは、現在の要素の onPaste イベントハンドラーを返します。 {{event("paste")}} の W3C 草稿を参照してください。</p>
+
+<h2 id="Syntax" name="Syntax">構文</h2>
+
+<pre class="syntaxbox"><em>element</em>.onpaste = <em>functionRef</em>;</pre>
+
+<p>ここでの <em>functionRef</em> は関数です。それはたいてい、他の場所で宣言された関数の名前、あるいは <em>function 式</em>です。詳しくは <a href="/ja/docs/Web/JavaScript/Reference/Global_Objects/Function">JavaScript リファレンス:Functions</a> を参照してください。</p>
+
+<h2 id="Example" name="Example">例</h2>
+
+<pre class="brush:html">&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;onpaste event example&lt;/title&gt;
+&lt;/head&gt;
+
+&lt;body&gt;
+&lt;h1&gt;Play with this editor!&lt;/h1&gt;
+&lt;textarea id="editor" rows="3" cols="80"&gt;
+Try pasting text into this area!
+&lt;/textarea&gt;
+
+&lt;script&gt;
+function log(txt) {
+ document.getElementById("log").appendChild(document.createTextNode(txt + "\n"));
+}
+
+function pasteIntercept(evt) {
+ log("Pasting!");
+}
+
+document.getElementById("editor").addEventListener("paste", pasteIntercept, false);
+&lt;/script&gt;
+
+&lt;h2&gt;Log&lt;/h2&gt;
+&lt;textarea rows="15" cols="80" id="log" readonly="true"&gt;&lt;/textarea&gt;
+&lt;/body&gt;
+&lt;/html&gt;</pre>
+
+<p>この例は、テキストエリアへの貼り付けのログを表示します。</p>
+
+<h2 id="Notes" name="Notes">メモ</h2>
+
+<p>このイベントは、ユーザがテキストを貼り付けしようとしたときに発生します。</p>
+
+<p>Firefox 13 から、この機能は設定 <code>dom.event.clipboardevents.enabled</code> で制御されます。既定値は <code>true</code> ですが無効化できます。</p>
+
+<h2 id="Specification" name="Specification">仕様書</h2>
+
+<p>仕様の一部ではありません。</p>
+
+<h2 id="Notes_2" name="Notes_2">メモ</h2>
+
+<p>現在、 DOM だけでペーストされたテキストを得る方法はありません。その情報を得るためには {{ Interface("nsIClipboard") }} を用いる必要があります。</p>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの対応</h2>
+
+<p class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力したいのであれば、 <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</p>
+
+<p>{{Compat("api.HTMLElement.onpaste")}}</p>
+
+<h2 id="See_also" name="See_also">関連情報</h2>
+
+<ul>
+ <li>{{event("paste")}}</li>
+ <li>{{domxref("HTMLElement.oncopy")}}</li>
+ <li>{{domxref("HTMLElement.oncut")}}</li>
+</ul>