WorksheetsLesson 8: Understanding JavaScript and Coding Essentials
Total questions: 20
Worksheet time: 10mins
jQuery, MooTools, and YUI are examples of JavaScript ______.
methods
libraries
event handlers
functions
Which of the following is a valid name for a JavaScript function?
1example$1
[abc]var1_$
example$1
*my.function
Which syntax defines a new variable in JavaScript?
new
type
value
var
4. What is the proper syntax for an alert box?
alert{'You clicked the button'}
alert = 'You clicked the button'
alert('You clicked the button')
(alert)('You clicked the button')
Which JavaScript property do you use to change the current content of an HTML element?
innerHTML
insideHTML
modifyHTML
changeHTML
Which symbol or punctuation mark indicates the end of a JavaScript statement?
closing curly bracket
question mark
semicolon
closing quote mark
Which of the following is true of alert boxes? (Choose all that apply.)
They are often used in business and consumer applications.
They respond to user actions.
They are used to send and receive files.
They are commonly used for testing and debugging.
Which technology is most often used to add action and interactivity to a Web application?
HTML
CSS
javaScript
all of the above
A computer program is most like a ________?
shopping list
newspaper article
memo
recipe
Which of the following is true of JavaScript functions?
Functions are reusable.
The action of a function is the sequence of the actions of the statements inside of it.
The definition of a function provides action.
A function is always custom-created.
You can include JavaScript code in which section of an HTML document?
<title>
doctype declaration
<script>
<body>
What is the purpose of a variable?
stands for data
names a sequence of actions
invokes actions
works only with an alert box
You are preparing to create an application. Which of the following might be highly useful to reduce the amount of time spent coding?
variables
JavaScript libraries
identifiers
functions
What is the following general code syntax most often associated with?
<script type = "text/javascript"
src = "URL or local address"></script>
variables
JavaScript libraries
identifiers
functions
What is the general action of the getElementById() method?
exchange files with a Web server
save data to local storage
alphabetize data
access display elements
In JavaScript, what is an action, such as a mouse click, that triggers a different action to occur?
variable
function
event
routine
Which event occurs right after all HTML has been displayed?
onLoad
onEvent
onHTML
onDisplay
Which of the following is true of JavaScript methods?
they are exactly the same as functions
they’re always associated and used with a particular object
isNaN() is an example of a JavaScript method
document.getElementById() is an example of a JavaScript function
Which of the following can you use in JavaScript to add elements after the HTML displays onscreen? (Choose all that apply.)
getElementById
createElement
appendElement
appendChild
You are creating an application that shows and hides a paragraph based on the value a
user enters. Which of the following is most appropriate for coding the show/hide interactivity?
innerHTML
createElement
appendChild
display attribute
