- From: Alex Kizer <notifications@github.com>
- Date: Sat, 01 Dec 2018 11:32:39 -0800
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/dom/issues/718@github.com>
https://dom.spec.whatwg.org/commit-snapshots/23ec6421f47ab629bd14dfc6d4910414dc443d0b/#introduction-to-dom-events > Throughout the web platform events are dispatched to objects to signal an occurrence, such as network activity or user interaction\. These objects implement the EventTarget interface and can therefore add event listeners to observe events by calling addEventListener\(\): > > obj\.addEventListener\("load", imgFetched\) > > function imgFetched\(ev\) \{ > // great success > … > \} > > Event listeners can be removed by utilizing the removeEventListener\(\) method, passing the same arguments\. > > Events are objects too and implement the Event interface \(or a derived interface\)\. In the example above ev is the event\. **It is passed as argument to event listener’s callback** \(typically a JavaScript Function as shown above\)\. Event listeners **key off** the event’s type attribute value \("load" in the above example\)\. **The event’s target attribute value returns the object** to which the event was dispatched \(obj above\)\. > > **Now while typically** events are dispatched by the user agent as the result of user interaction or the completion\.\.\. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/718
Received on Saturday, 1 December 2018 19:33:01 UTC