<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><section><h1>form 要素 onreset 属性 (HTML, XHTML 1)</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HTML</anchor> の <code class="HTMLe"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">form</anchor></code> 要素の
<dfn><code class="HTMLa">onreset</code> 属性</dfn>は、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">フォーム</anchor>が<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">再設定</anchor>される時に発生する<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">事象</anchor>に関する<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">内在事象</anchor>属性です。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end> 仕様書:<ul><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">HTML 4</anchor><ul><li><code class="HTMLa">onreset</code> 属性
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="IW" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="HTML4:&quot;interact/scripts.html#adef-onreset&quot;">IW:HTML4:&quot;interact/scripts.html#adef-onreset&quot;</anchor-external></li></ul></li></ul></p><form xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" ref="comment"></form><section><h1>代替</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[3]</anchor-end> 内在事象属性は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">表現と構造の分離</anchor>の原則に反するので、
好ましくないと考える人もいます。また、 <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">DOM 0</anchor>
に基づく古い設計です。</p><p>代わりに、 <code class="HTMLe"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">script</anchor></code> 要素などにより関連付けたスクリプト内で
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">DOM 2</anchor> 以上の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">事象</anchor>に関するメソッド等が利用できます。
DOM 水準 2 や DOM 水準 3 はこの属性に対応する
DOM の事象 <code class="DOM"><var>ev:</var><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">reset</anchor></code> を用意しています。</p><form xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" ref="comment"></form></section><section><h1>属性値</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="4" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[4]</anchor-end> この属性の値は <code class="SGML">%<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Script</anchor></code> です。 <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">SGML</anchor>
的には <code class="SGML"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">CDATA</anchor></code> です。
自称が発生したときに実行するスクリプトの code
を記述します。<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">スクリプト言語</anchor>は、
<code class="HTTP"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Content-Script-Type</anchor></code> によります。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[5]</anchor-end> この属性は省略可能です。</p></section></section><section><h1>関連</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[7]</anchor-end> 定義上、 <code class="HTMLe"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">fieldset</anchor></code> が再設定されるときには
<code class="DOMe" xml:lang="en">reset</code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">事象</anchor>は発生しません<del>し、 <code class="HTMLe"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">fieldset</anchor></code> 要素に <code class="HTMLa" xml:lang="en">onreset</code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">属性</anchor>を指定することはできません</del>。
また、個々のフォーム<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">制御子</anchor>ではなく <code class="HTMLe"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">form</anchor></code>
要素の属性であることにも注意してください。</p></section><section><h1>歴史</h1><ul><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="6" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[6]</anchor-end> <em>Alertbox: リセットとキャンセルボタン(2000年4月16日)</em> <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://www.usability.gr.jp/alertbox/20000416.html">http://www.usability.gr.jp/alertbox/20000416.html</anchor-external></li></ul><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="13" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[13]</anchor-end> <cite>猫式Webメモ</cite> <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://d.hatena.ne.jp/nekoshiki/20040312#p2">http://d.hatena.ne.jp/nekoshiki/20040312#p2</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="14" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[14]</anchor-end> <cite xml:lang="en">Web Applications 1.0 r7609     Mostly, browsers seem to make these events bubble.</cite>
( (<time>2012-12-30 12:38:00 +09:00</time> 版))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://html5.org/tools/web-apps-tracker?from=7608&amp;to=7609">http://html5.org/tools/web-apps-tracker?from=7608&amp;to=7609</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="15" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[15]</anchor-end> <cite xml:lang="en-GB-x-Hixie">Web Forms 2.0</cite>
(<time>2009-01-05 20:07:15 +09:00</time> 版)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://www.whatwg.org/specs/web-forms/current-work/#additions">http://www.whatwg.org/specs/web-forms/current-work/#additions</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="8" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[8]</anchor-end> <cite xml:lang="en">Web Applications 1.0 r5580       Missed .onreset somehow.Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=10892</cite>
( (<time>2010-10-05 09:03:00 +09:00</time> 版))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://html5.org/tools/web-apps-tracker?from=5579&amp;to=5580">http://html5.org/tools/web-apps-tracker?from=5579&amp;to=5580</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[9]</anchor-end> <cite xml:lang="en">Web Applications 1.0 r8718     Make sure reset() can't fire a popup</cite>
( (<time>2014-08-27 07:21:00 +09:00</time> 版))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://html5.org/r/8718">http://html5.org/r/8718</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="10" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[10]</anchor-end> <cite xml:lang="en">Web Applications 1.0 r8886  Make sure &lt;textarea&gt; is reset when you parse the end tag, since otherwise it wouldn't actually ever work...</cite>
(<time>2015-03-05 08:08:00 +09:00</time> 版)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://html5.org/r/8886">https://html5.org/r/8886</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="11" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[11]</anchor-end> <cite xml:lang="en">Resetting a textarea should reset its dirty value flag · whatwg/html@d0711b0</cite>
(<time>2016-03-24 15:26:17 +09:00</time> 版)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/html/commit/d0711b022b24294340508357c91ce5687b998b7d">https://github.com/whatwg/html/commit/d0711b022b24294340508357c91ce5687b998b7d</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="12" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[12]</anchor-end> <cite xml:lang="en">Editorial: clarify reset the form owner's first step · whatwg/html@6e5ecb0</cite>
(<time>2016-03-26 12:20:27 +09:00</time> 版)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/html/commit/6e5ecb099faf2c1d2b375081cb9bf03e92e8f088">https://github.com/whatwg/html/commit/6e5ecb099faf2c1d2b375081cb9bf03e92e8f088</anchor-external></p></section><section><h1>メモ</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end> reset button うざい!</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="16" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[16]</anchor-end> <cite xml:lang="en">Update textarea textContent/defaultValue/value interaction</cite>
(<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">domenic</anchor>著, <time>2017-06-16 05:46:10 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/html/commit/5afbba1cf62ee01bc6af3fd220d01f3f7591a0fc">https://github.com/whatwg/html/commit/5afbba1cf62ee01bc6af3fd220d01f3f7591a0fc</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="17" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[17]</anchor-end> <cite xml:lang="en">Textarea defaultValue handling doesn't really match UAs (who don't match each other) when there are child elements · Issue #2752 · whatwg/html</cite>
(<time>2017-06-29 17:20:01 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/html/issues/2752">https://github.com/whatwg/html/issues/2752</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="18" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[18]</anchor-end> <cite xml:lang="en">Editorial: clarify a long conditional</cite>
(<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">annevk</anchor>著, <time>2017-07-24 16:40:00 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/html/commit/dfb3f61140e28a10e1a63c55d566270a4785f57b">https://github.com/whatwg/html/commit/dfb3f61140e28a10e1a63c55d566270a4785f57b</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="19" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[19]</anchor-end> <cite xml:lang="en">Editorial: clarify a long conditional by annevk · Pull Request #2862 · whatwg/html</cite>
(<time>2017-07-28 11:45:33 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/html/pull/2862">https://github.com/whatwg/html/pull/2862</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="20" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[20]</anchor-end> <cite xml:lang="en">element interaction: introduce clear algorithm concept</cite>
(<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">andreastt</anchor>著, <time>2017-11-25 00:04:53 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/w3c/webdriver/commit/bc32d801107b445a3268653671732d83b3dfac1f">https://github.com/w3c/webdriver/commit/bc32d801107b445a3268653671732d83b3dfac1f</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="21" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[21]</anchor-end> <cite xml:lang="en">Textarea/text input text cursor position is not updated by reset algorithm · Issue #3468 · whatwg/html</cite>
(<time>2018-03-17 17:54:31 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/html/issues/3468">https://github.com/whatwg/html/issues/3468</anchor-external></p></section></body></html>