@@ -52,20 +52,24 @@ functions as _handlers_ for specific events.
52
52
</script>
53
53
```
54
54
55
- {{index "click event", "addEventListener method"}}
55
+ {{index "click event", "addEventListener method", "window object" }}
56
56
57
- The ` addEventListener ` method registers its second argument to be
58
- called whenever the event described by its first argument occurs.
57
+ The ` window ` binding refers to a built-in object provided by the
58
+ browser. It represents the ((browser)) window that contains the
59
+ document. Calling its ` addEventListener ` method registers the second
60
+ argument to be called whenever the event described by its first
61
+ argument occurs.
59
62
60
63
## Events and DOM nodes
61
64
62
- {{index "addEventListener method", "event handling"}}
65
+ {{index "addEventListener method", "event handling", "window object" }}
63
66
64
67
Each ((browser)) event handler is registered in a context. We called
65
- ` addEventListener ` on the ` window ` object before. This method can also
66
- be found on ((DOM)) elements and some other types of objects. Event
67
- listeners are only called when the event happens in the context of the
68
- object they are registered on.
68
+ ` addEventListener ` on the ` window ` object before to register a handler
69
+ for the whole window. Such a method can also be found on ((DOM))
70
+ elements and some other types of objects. Event listeners are only
71
+ called when the event happens in the context of the object they are
72
+ registered on.
69
73
70
74
``` {lang: "text/html"}
71
75
<button>Click me</button>
0 commit comments