January 2018
Intermediate to advanced
678 pages
20h 16m
English
Whew! We finally finished examining the Point class definition. In this section, we move on to the Point Tracker web page’s event-handler functions. The Point Tracker web page’s html element has an onclick attribute that calls the captureClick event-handler function when the user clicks anywhere on the web page. Here’s the html element’s start tag with the onclick attribute:
<html lang="en" onclick="captureClick(event);">
Originally, we added the onclick attribute to the web page’s body element instead of to the html element. That works OK, but not great. We want mouse clicks to be captured anywhere on the web page’s viewport. The viewport is the area below the browser window’s address bar and within the browser window’s ...
Read now
Unlock full access