Skip to content

Commit 23cb41f

Browse files
committed
Clarify window object in Chapter 15
Closes #413
1 parent 1380399 commit 23cb41f

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

15_event.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,24 @@ functions as _handlers_ for specific events.
5252
</script>
5353
```
5454

55-
{{index "click event", "addEventListener method"}}
55+
{{index "click event", "addEventListener method", "window object"}}
5656

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.
5962

6063
## Events and DOM nodes
6164

62-
{{index "addEventListener method", "event handling"}}
65+
{{index "addEventListener method", "event handling", "window object"}}
6366

6467
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.
6973

7074
```{lang: "text/html"}
7175
<button>Click me</button>

0 commit comments

Comments
 (0)