Web Development and Design Foundations with XHTML, 5th Edition

(Steven Felgate) #1

(^566) Chapter 14 A Brief Look at JavaScript
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;
6.A condition (productCost > 5)is used in an
ifstatement. Which of the following values of
productCostwill result in this condition evalu-
ated as true?
a. 4
b. 5
c. 5.1
d. none of the above
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
8.Which of the following is the code to access the
contents of an input box named userDataon 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
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();">
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 ifstatement
d. use an onclickevent handler
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.
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 varstatement.
15.The

Free download pdf