Class: Event

Event


new Event(type [, opt_target])

A base class for event objects, so that they can support preventDefault and stopPropagation.
Parameters:
Name Type Argument Description
type string | goog.events.EventId Event Type.
opt_target Object <optional>
Reference to the object that is the target of this event. It has to implement the `EventTarget` interface declared at http://developer.mozilla.org/en/DOM/EventTarget.

Members


currentTarget :Object|undefined

Object that had the listener attached.
Type:
  • Object | undefined

defaultPrevented :boolean

Whether the default action has been prevented. This is a property to match the W3C specification at #events-event-type-defaultPrevented. Must be treated as read-only outside the class.
Type:
  • boolean

target :Object|undefined

Target of the event.
Type:
  • Object | undefined

type :string

Event type.
Type:
  • string

Methods


preventDefault()

Prevents the default action, for example a link redirecting to a url.

stopPropagation()

Stops event propagation.