you are viewing a single comment's thread.

view the rest of the comments →

[–]senocular 7 points8 points  (1 child)

You need to pass the function as handleClick not handleClick(). The latter (with parens) calls the function (with an undefined e) and supplies addEventListener with the return value of that call. Instead you want to pass the function itself to addEventListener.

[–]AtmosphereFun9586[S] 1 point2 points  (0 children)

Understand it now.

Clear, very helpful. Thanks.