Skip to content

Commit cb1e99a

Browse files
committed
Fix leftover uses of event.which in Chapter 15
Closes marijnh#281
1 parent 036f7f8 commit cb1e99a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

15_event.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ information about the event. For example, if we want to know _which_
138138
button.addEventListener("mousedown", event => {
139139
if (event.button == 0) {
140140
console.log("Left button");
141-
} else if (event.which == 1) {
141+
} else if (event.button == 1) {
142142
console.log("Middle button");
143-
} else if (event.which == 2) {
143+
} else if (event.button == 2) {
144144
console.log("Right button");
145145
}
146146
});

0 commit comments

Comments
 (0)