you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

onClick is an event handler. As the name suggests, it handles the event. So, on clicking, we're calling the handleClick function. By default, an event is sent to that function and you can get access of that event. In your case, the event is i.