Which of the following will return a live HTML collection?
document.querySelector()
document.getElementByClassName()
document.getElementById()
document.querySelectorAll()
Which method would you use to stop a default action?
stopDefault()
preventDefault()
endDefault()
you can’t stop a default action
During a keydown event, altKey and ctrlKey will repeat if result of Boolean operator is true
True
False
The Array.from() method will not work in which of the following browsers
Internet Explorer
Google Chrome
Microsoft Edge
Mozilla Firefox
An HTML file can contain a reference for an external file. The…
Javascript
CSS
An image
All of the above
To add a class to an element without overwriting the other class…
element.classList.add()
element.className
element.classList.contains()
element.class
What is the property on the event object for a click event…
clickedOn
event
click
rub
In order to reduce security problems, JavaScript runs in a restrictive environment called a:
firewall
sandbox
sean's house
tunnel
When adding event handler
add event listener
add event
event listener
Events are fired on the target element and then each of the target element’s parents.
propagation
targeting
capturing
observing
Leaf nodes can contain...
HTML nodes
HTML tags
text content
other elements
In order to use JavaScript on a web page, there must be a(n) _______ file.
security
image
HTML
When linking to JavaScript in a web page, the defer attribute will:
download the JavaScript file and run it right away
defer is not used with JavaScript
wait until the page is loaded and then download and run the JavaScript file
download the JavaScript file but run it after the page is loaded
How would you edit the background color of the element paragraph?
paragraph.style.backgroundcolor
paragraph.style.background-color
paragraph.backgroundcolor
paragraph.style.backgroundColor
Which of these is an event?
dblclick
keydown
DOM stand for __________________
Document Object Model
Document Overall Method
Document variable
Document Observer Method
In order to reduce security problems, JavaScript runs in a restricted environment…
Skip for now
skip
skip1
An event can be ________
never initiated by the user
an interaction with our page
a list of node child
none of the above
Using querySelector(), the . symbol will select elements:
By the class
By the tag
By the name
By the ID
Using querySelector(), the # symbol will select elements:
By the id
Which has the highest order of precedence?
Internal Stylesheets
the style property
Embedded Stylesheets
Inherited styles
The first thing the browser does when loading a webpage is:
size the HTML file to the screen
download the HTML file
load the JavaScript DOM functions to the page
open a model of the HTML file
What are the steps of a webpage being displayed?
a request is made when a link is clicked
the page and its resources are downloaded
javascript file downloaded and loaded by defer
event.repeat will return what type of value if a key is held?
Boolean
null
number
Array
Which command allows you to add text directly without first creating a text node?
el.textContent
el.appendChild()
el.CreateTextNode()
el.setAttribute()
In HTML, the type attribute is required in the <script> tag
You have added an event listen to the following code. Which of these will remove…
beta.addEventListener(‘click’, newgame);
newgame.removeEventListener(‘click’, alpha);
beta.removeEventListener();
beta.removeEventListener(‘click’, newgame);
removeEventListener(‘click’, newgame);
When using document.querySelectorAll() it returns:
A list
Individual objects for each element selected
An array like object
An array
A URL is used to:
download the closest match
get email
determine what program should download the file
uniquely identifies files on the Web
The second parameter of an addEventListener() accepts a ______________ variable.
array
list
function
The DOM is organized like a _____.
Circle
Block
Tree
Square
Like HTML, the default character-set for JavaScript is:
utf-8
emoji-23
defer
type
When a user releases a key, which event is sent?
keyup
shiftKey
space
If you have a <p> element stored in the variable para and you want to add text, which command should you use?
para.insert(txt)
para.addChild(txt)
paragraph.add(txt)
para.appendChild(txt)
To stop many events that may fire many times in a row, we can use stopPropagation()
You can use the function setTimeout() to schedule a function.
What is the global variable that contains the DOM?
head
window
body
document
What is the advantage of HTTPS over HTTP?
it is less expensive
it is encrypted
it is faster
all of the above
In order to use JavaScript on a webpage, you must include the _____.
src
script
js
link
Which event relates to the action of a keyboard being pressed?
keyclick
keypress
keyset
keybutton
The scroll event is fired every time the page is scrolled.