aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/event/defaultprevented
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/event/defaultprevented
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/event/defaultprevented')
-rw-r--r--files/zh-cn/web/api/event/defaultprevented/index.html54
1 files changed, 54 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/event/defaultprevented/index.html b/files/zh-cn/web/api/event/defaultprevented/index.html
new file mode 100644
index 0000000000..f72e97f936
--- /dev/null
+++ b/files/zh-cn/web/api/event/defaultprevented/index.html
@@ -0,0 +1,54 @@
+---
+title: event.defaultPrevented
+slug: Web/API/Event/defaultPrevented
+tags:
+ - API
+ - DOM
+ - Event
+ - Property
+translation_of: Web/API/Event/defaultPrevented
+---
+<p>{{ APIRef("DOM") }}</p>
+
+<h2 id="概述">概述</h2>
+
+<p>返回一个布尔值,表明当前事件是否调用了 {{ domxref("event.preventDefault()") }}方法。</p>
+
+<div class="note"><strong>注意:</strong>你应该使用该属性来代替以前的非标准的已经被废弃的<code>getPreventDefault()</code>方法 (查看{{ bug("691151") }}).</div>
+
+<h2 id="语法">语法</h2>
+
+<pre class="eval">bool = event.defaultPrevented
+</pre>
+
+<h2 id="示例">示例</h2>
+
+<pre class="brush: js"> if (e.defaultPrevented) {
+ /* 事件的默认动作已被取消*/
+ }
+</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('DOM WHATWG', '#dom-event-defaultprevented', 'Event.defaultPrevented()')}}</td>
+ <td>{{ Spec2('DOM WHATWG') }}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+
+
+<p>{{Compat("api.Event.defaultPrevented")}}</p>