aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/globaleventhandlers/onreset
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/zh-cn/web/api/globaleventhandlers/onreset
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/globaleventhandlers/onreset')
-rw-r--r--files/zh-cn/web/api/globaleventhandlers/onreset/index.html63
1 files changed, 63 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/globaleventhandlers/onreset/index.html b/files/zh-cn/web/api/globaleventhandlers/onreset/index.html
new file mode 100644
index 0000000000..7f43a32d5a
--- /dev/null
+++ b/files/zh-cn/web/api/globaleventhandlers/onreset/index.html
@@ -0,0 +1,63 @@
+---
+title: GlobalEventHandlers.onreset
+slug: Web/API/GlobalEventHandlers/onreset
+translation_of: Web/API/GlobalEventHandlers/onreset
+---
+<p>{{ ApiRef() }}</p>
+
+<p>The <code><strong>GlobalEventHandlers.onreset</strong></code> 属性包含 {{domxref("EventHandler")}} ,当收到一个{{event("reset")}} 事件时触发</p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre>window.onreset = funcRef;
+</pre>
+
+<h3 id="Parameters" name="Parameters">参数</h3>
+
+<ul>
+ <li><code>funcRef</code> 是一个函数的引用.</li>
+</ul>
+
+<h2 id="Example" name="Example">例子</h2>
+
+<pre class="eval">&lt;html&gt;
+&lt;script&gt;
+function reg() {
+ window.captureEvents(Event.RESET);
+ window.onreset = hit;
+}
+
+function hit() {
+ alert('hit');
+}
+&lt;/script&gt;
+
+&lt;body onload="reg();"&gt;
+ &lt;form&gt;
+ &lt;input type="reset" value="reset" /&gt;
+ &lt;/form&gt;
+ &lt;div id="d"&gt; &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
+</pre>
+
+<h2 id="Notes" name="Notes">备注</h2>
+
+<p>reset 事件只有在用户点击表单中的reset按钮时才会被触发 (<code>&lt;input type="reset"/&gt;</code>).</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-onreset','onreset')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>