aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/api/event/defaultprevented/index.html
blob: d0407443c7e34b606221bdb9fda1abf839638c95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
title: Event.defaultPrevented
slug: Web/API/Event/defaultPrevented
translation_of: Web/API/Event/defaultPrevented
---
<p>{{ ApiRef("DOM") }}</p>

<h3 id="Resumo">Resumo</h3>

<p><span class="short_text" id="result_box" lang="pt"><span class="hps">Retorna um booleano</span> <span class="hps">que indica se</span> <span class="hps">ou não</span></span> {{ domxref("event.preventDefault()") }} foi chamado no evento.</p>

<div class="note"><strong>Nota:</strong> <span id="result_box" lang="pt"><span class="hps">Você deve usar</span> <span class="hps">isso em vez de</span> <span class="hps">a</span> <span class="hps">não-padrão,</span> método <span class="hps">desatualizado</span></span><code> getPreventDefault()</code>  (ver {{ bug(691151) }}).</div>

<h3 id="Sintaxe">Sintaxe</h3>

<pre class="eval">bool = event.defaultPrevented </pre>

<h3 id="Exemplo">Exemplo</h3>

<pre> if (e.defaultPrevented) {
   /* <span class="short_text" id="result_box" lang="pt"><span class="hps">o padrão</span> <span class="hps">foi impedido</span></span> */
 }
</pre>

<h3 id="Compatibilidade_do_navegador"><span class="short_text" id="result_box" lang="pt"><span class="hps">Compatibilidade do navegador</span></span></h3>

<p>{{ CompatibilityTable() }}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Recurso</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Suporte básico</td>
   <td>{{ CompatChrome(18) }}</td>
   <td>{{ CompatGeckoDesktop("6.0") }}</td>
   <td>{{ CompatIE(9.0) }}</td>
   <td>{{ CompatOpera(11.0) }}</td>
   <td>{{ CompatSafari("5.0") }}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Suporte básico</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatGeckoMobile("6.0") }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatUnknown() }}</td>
   <td>{{ CompatSafari(5.0) }}</td>
  </tr>
 </tbody>
</table>
</div>

<h3 id="Especificação">Especificação</h3>

<ul>
 <li><a class="external" href="http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413/events.html#Events-Event-defaultPrevented" title="http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413/events.html#Events-Event-defaultPrevented">Eventos DOM 3</a></li>
</ul>