EventTarget

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

* Some parts of this feature may have varying levels of support.

EventTarget es una interfaz implementada por los objetos que pueden administrar eventos y sus escuchadores.

Element, document, y window son los objetivos más comunes de un evento, pero otros objetos pueden serlo también, por ejemplo XMLHttpRequest, AudioNode, AudioContext, entre otros.

Muchos objetivos de eventos tales como: elementos, documentos y ventanas, también admiten la configuración de controladores de eventos a través de propiedades y atributos.

Métodos

EventTarget.addEventListener()

Registre un controlador de eventos de un tipo de evento específico en EventTarget.

EventTarget.removeEventListener()

Elimina un detector de eventos del EventTarget.

EventTarget.dispatchEvent()

Enviar un evento a este EventTarget.

Especificaciones

Specification
DOM
# interface-eventtarget

Compatibilidad con navegadores

BCD tables only load in the browser

Vea también