HTML and CSS Reference
In-Depth Information
5. Which of the following will assign the value 5 to
the variable productCost ?
a. productCost = > 5;
b. productCost < = 5;
c. productCost = = 5;
d. productCost = 5;
10. Which of the following is a technique for creat-
ing reusable JavaScript code?
a. define a function
b. create a script block
c. define an if statement
d. use an onclick event handler
6. A condition (productCost > 5) is used in an
if statement. Which of the following values of
productCost will result in this condition evalu-
ated as true ?
a. 4
b. 5
c. 5.1
d. none of the above
Fill in the Blank
11. The term ____________________ refers to using
JavaScript to detect information about the Web
browser application.
12. A ____________________ is a select list that
allows the user to select an option to load
another Web page.
7. Which of the following can describe JavaScript,
as used in a Web page?
a. a scripting language
b. a markup language
c. an easy form of Java
d. a language created by Microsoft
13. The ____________________ object is assumed to
exist and it is not necessary to include it as an
object when referring to its methods and properties.
14. We do not need to declare a
____________________, but we could choose to
do so with the var statement.
8. Which of the following is the code to access the
contents of an input box named userData on a
form?
a. document.forms[0].userData
b. document.forms[0].userData.value
c. document.forms[0].userData.contents
d. document.forms[0].userData.data
15. The <button> can be used with a(n)
____________________ event handler to run a
script when the user clicks a button.
Short Answer
9. Which of the following is the code to run a func-
tion called isValid() when the user clicks the
submit button?
a. <input type="button"
onclick="isValid();" />
b. <input type="submit"
onsubmit="isValid();" />
c. <form method="post" action="URL"
onsubmit="return isValid();">
d. <form method="post" action="URL"
onclick="return isValid();">
16. Describe at least three popular uses for
JavaScript.
17. Describe how you could debug JavaScript code
when it is not working properly.
Search WWH ::




Custom Search