aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/api/eventlistener/index.html
blob: 0e00e865a2d094ef48d0953f8391e4417902fe6a (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
---
title: EventListener
slug: Web/API/EventListener
tags:
  - API
  - DOM
  - Eventos DOM
translation_of: Web/API/EventListener
---
<p>{{APIRef("DOM Events")}}</p>

<h2 id="Method_overview" name="Method_overview">Visão Geral</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <td><code>void <a href="#handleEvent()">handleEvent</a>(in Event event);</code></td>
  </tr>
 </tbody>
</table>

<h2 id="Methods" name="Methods">Métodos</h2>

<h3 id="handleEvent()" name="handleEvent()">handleEvent()</h3>

<p>Este método é chamado sempre que ocorrer o evento para qual a interface do  <code>EventListener for registrada</code>.</p>

<pre class="eval">void handleEvent(
  in Event event
);
</pre>

<h5 id="Parameters" name="Parameters">Parâmetros</h5>

<dl>
 <dt><code>event</code></dt>
 <dd>O {{ domxref("Evento") }} DOM que foi acionado.</dd>
</dl>

<h3 id="Remarks" name="Remarks">Observaçōes</h3>

<p>Conforme a interface for marcada com a flag <code><span class="nowiki">[function]</span></code>, todos os objetos <a href="/en/JavaScript/Reference/Global_Objects/Function" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a> automaticamente implementtam essa interface. Chamar o método {{ manch("handleEvent") }} em uma dessas implementaçōes automaticamente invoca a função.</p>

<h2 id="See_also" name="See_also">Veja também</h2>

<ul>
 <li>{{ spec("http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventListener","Document Object Model Events: EventListener","REC") }}</li>
</ul>