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/htmlformelement/reset_event | |
| 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/htmlformelement/reset_event')
| -rw-r--r-- | files/ja/web/api/htmlformelement/reset_event/index.html | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/files/ja/web/api/htmlformelement/reset_event/index.html b/files/ja/web/api/htmlformelement/reset_event/index.html new file mode 100644 index 0000000000..204cd3aa3f --- /dev/null +++ b/files/ja/web/api/htmlformelement/reset_event/index.html @@ -0,0 +1,111 @@ +--- +title: 'HTMLFormElement: reset イベント' +slug: Web/API/HTMLFormElement/reset_event +tags: + - API + - Event + - Forms + - HTML DOM + - HTMLFormElement + - Reference +translation_of: Web/API/HTMLFormElement/reset_event +--- +<div>{{APIRef}}</div> + +<p><strong><code>reset</code></strong> イベントは {{HTMLElement("form")}} がリセットされたときに発行されます。</p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row">バブリング</th> + <td>あり (ただし、バブリングしない単純なイベントとして指定されている)</td> + </tr> + <tr> + <th scope="row">キャンセル</th> + <td>可</td> + </tr> + <tr> + <th scope="row">インターフェイス</th> + <td>{{DOMxRef("Event")}}</td> + </tr> + <tr> + <th scope="row">イベントハンドラープロパティ</th> + <td>{{domxref("GlobalEventHandlers.onreset")}}</td> + </tr> + </tbody> +</table> + +<h2 id="Examples" name="Examples">例</h2> + +<p>この例は {{domxref("EventTarget.addEventListener()")}} を使用してフォームがリセットされるのを、実行されたときに現在の {{domxref("Event.timeStamp")}} をログ出力します。</p> + +<h3 id="HTML">HTML</h3> + +<pre class="brush: html notranslate"><form id="form"> + <label>Test field: <input type="text"></label> + <br><br> + <button type="reset">Reset form</button> +</form> +<p id="log"></p></pre> + +<h3 id="JavaScript">JavaScript</h3> + +<pre class="brush: js notranslate">function logReset(event) { + log.textContent = `Form reset! Time stamp: ${event.timeStamp}`; +} + +const form = document.getElementById('form'); +const log = document.getElementById('log'); +form.addEventListener('reset', logReset);</pre> + +<h3 id="Result" name="Result">結果</h3> + +<p>{{EmbedLiveSample("Examples")}}</p> + +<h2 id="Specifications" name="Specifications">仕様書</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">仕様書</th> + <th scope="col">状態</th> + <th scope="col">備考</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName("HTML WHATWG", "indices.html#event-reset", "reset")}}</td> + <td>{{Spec2("UI Events")}}</td> + <td>変更なし</td> + </tr> + <tr> + <td>{{SpecName("HTML5.2", "fullindex.html#eventdef-global-reset", "reset")}}</td> + <td>{{Spec2("HTML5.2")}}</td> + <td>変更なし</td> + </tr> + <tr> + <td>{{SpecName("HTML5.1", "fullindex.html#eventdef-global-reset", "reset")}}</td> + <td>{{Spec2("HTML5.1")}}</td> + <td>変更なし</td> + </tr> + <tr> + <td>{{SpecName("HTML5 W3C", "index.html#events-0", "reset")}}</td> + <td>{{Spec2("HTML5 W3C")}}</td> + <td>初回定義</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> + +<div> +<div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div> + +<p>{{Compat("api.HTMLFormElement.reset_event")}}</p> +</div> + +<h2 id="See_also" name="See_also">関連情報</h2> + +<ul> + <li>HTML の {{HTMLElement("form")}} 要素</li> +</ul> |
