1/16
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Which tag is used to let the browser know that it is about to see JavaScript code?
Where can you put JavaScript?
A) In the section
B) In the section
C) In an external file
In B) and C) above
In A), B) and C) above
In A), B) and C) above
Which attribute is used to link to an external JavaScript file?
file; e.g., file = "extFile.js"
src; e.g., src = "extFile.js"
href; e.g., href = "extFile.js"
script; e.g., script = "extFile.js"
src; e.g., src = "extFile.js".
Which word is used to define a function in JavaScript?
function
func
define
function
Which of the following best defines the relationship between defining a function and calling a function?
A function can be defined multiple times in a single file
A function can be called multiple times in a single file.
A function can be called multiple times in a single file
A function can be called multiple times in a single file.
True
False
True
You can call a function without it being defined.
True
False
False
One of the events that the JavaScript API will listen for is onload.
True
B: False
True
You can use single quotes or double quotes when calling a function with an event.
True
False
True
Consider the following code:
This is paragraph one
This is paragraph two
The function Hello() will be called every time:
A) The page is loaded
B) The user clicks on any paragraph on the page
C) The user clicks on the second paragraph on the page
A and C
The function is never called.
A) The page is loaded.
Consider the following code:
This is paragraph one
This is paragraph two
The function Hello() will be called every time:
A) The user clicks on any paragraph on the page
B) The user places his/her mouse over any paragraph on the page
C) The user clicks on the second paragraph on the page
A and C
The function is never called.
The user clicks on the second paragraph on the page
What is syntactically wrong with this function definition?
function Hello();{
alert("Hello");
document.write("Hello on the screen");
}
The semicolon after Hello()
The fact that you are outputting the message twice
You can't use document.write after using an alert.
The semicolon after Hello()
Which is the correct syntax to change the contents of the HTML element below?
This is a quiz.
document.querySelector('#quiz').innerHTML = "New content!";
document.querySelectorAll('p').innerHTML = "New content!";
document.querySelectorAll('p').innerHTML("New content!");
document.querySelector('#quiz').innerHTML ("New content!");
document.querySelector('#quiz').innerHTML = "New content!";
The following is valid JavaScript code:
True
False
True
The following is valid JavaScript code:
True
False
True
Which of the following best defines the difference between defining a function and calling a function?
Defining and calling a function are the same thing
You can call a function without it being defined first.
You can define a function without calling it.
You can define a function without calling it.
Which is the correct syntax to change the contents of the HTML element below?
This is a quiz.
document.getElementsByTagName('p').innerHTML = "New content!";
document.getElementsByTagName('p').innerHTML("New content!");
document.getElementById('quiz').innerHTML ("New content!");
document.getElementById('quiz').innerHTML = "New content!";
document.getElementById('quiz').innerHTML = "New content!";