January 2018
Intermediate to advanced
678 pages
20h 16m
English
addEventListener to Add Event ListenersIn our original Point Tracker web page implementation, the onclick event-handler attribute worked just fine for capturing a click on the distance button and again for capturing a click on the web page as a whole. For our improved version of the Web Tracker web page, we capture not only clicking on the web page, but also pressing the delete key on the web page. When the user presses delete, the delete key’s event handler removes the most recently created point by erasing its displayed coordinates. The mouse click event and the delete key event both need to be captured, regardless of where they occur on the web page, and that means using the html element. We could add an onkeydown event-handler ...
Read now
Unlock full access