Font size
WorksheetsIST_OPENING_DOM Review 11.14
Total questions: 29
Worksheet time: 14mins
What does the following code log?
<p>Para 1</p>
<p>Para 2</p>
<p>Para 3</p>
console.log(document.getElementsByTagName("p").innerHTML);
A. "Para 1, Para 2, Para3"
undefined
It throws an error
None of the choices
The following code will:
x++;
Add 1 to the previous value of x
Add 1 to the previous value of y
Subtract 1 from the previous value of x
Give an error message
Add 2 to the previous value of x.
A developer will use this to see details about code that she does not want the site user to necessarily see:
document.write();
var debug();
print.console();
console.log();
If I want to check whether two values are equal, which operator should I use?
=
==
equal
::
--
An example of camel casing:
getElementsByTagName
GetElementsByTagName
getelementsbytagName
GetelementsbytagName
getelementsbytagname
DOM get element by id is?
Document.Getelementbyid()
DOM.getElmentById()
Document.getElementByID()
document.getElementById()
What DOM Property is used to update the text of an HTML tag?
innerHTML
value
string
id
A variable:
Expresses a true-false statement
Takes in an input, does something with it, and then returns an output.
Runs a boolean (true/false) statement based on data entered
Stores a string, number, or boolean, and gives it a specific, case-sensitive name
What surrounds an if/else statement?
Quotations " "
Parenthesis ( )
Square Brackets [ ]
Curly Brackets { }
How can a developer show a pop-up message to the user?
alert
prompt
console.log
<p> tag
for ( var i = 0; i < 50; i++ )
How many times will this loop execute
51 times
49 times
50 times
0 times
How do you define a function in JavaScript
function = climbUp();
fun = "climbUp";
function climbUp();
fun = (climbUp());
A short form writing the word variable is
rav
VAR
var
varia
WHAT do "purple", "green" in this code refer to?
var x1= document.getElementById("purple").checked;
var x2= document.getElementById("green").checked;
They are the IDs of RadioButtons.
They are the names of radiobuttons
They are the names of textboxes
They are the names of drop-down list items
How do you change the text to "Alma Thomas"?
A
B
C
Which argument should we use to get the right DOM element?
(a)
How to get all elements by their tag name in JavaScript?
document.getElementsByTagName();
document.getElementsByTag();
document.getElementsByTabName();
document.getElementByTagName();
In Document Object Model (DOM), all the properties, methods and events that are available to a web developer for manipulating and creating web pages are organised into:
Classes
Objects
Modules
Variables
DOM represents a webpage in what way?
Dynamic structure
Recursive structure
Tree-like structure
Hash table structure
What are HTML Tags?
HTML tags are composed of three things: an opening tag, content and ending tag. Some tags are unclosed tags.
HTML tags are composed of three things: an opening tag, content and ending tag. All tags need to be closed.
HTML tags define metadata about an HTML document. Metadata is data (information) about data.
I didn't know that I was supposed to be studying
It is used mostly in the web pages to generate the dynamic content such as writing the validation message, password strength etc
innerHTML
innerDocument
innerText
innerTag
•The document object represents the whole html document.
True
False
JavaScript can't change all the HTML elements in the page
True
False
