This chapter is from the book
Workshop
Try to answer the following questions before looking at the “Answers” section that follows.
Quiz
What is an onClick event handler?
- An object that detects the mouse’s location in the browser
- A script that executes in response to the user clicking the mouse
- An HTML element that the user can click
How many <script> elements are permitted on a page?
- None
- Exactly one
- Any number
Which of these is NOT a true statement about variables?
- Their names are case sensitive.
- They can contain numeric or non-numeric information.
- Their names may contain spaces.
Answers
- b. An onClick event handler is a script that executes when the user clicks the mouse.
- c. You can use as many <script> elements as you need.
- c. Variable names in JavaScript must not contain spaces.