Javascript Chp. 5

25 July 2022
4.7 (114 reviews)
40 test answers

Unlock all answers in this set

Unlock answers (36)
question
True
answer
T/F The top-level object in the browser object model is the Window object, which represents a web browser window.
question
false
answer
T/F The objects in the BOM for any given web page depend on the contents of the page.​
question
false
answer
T/F The getElementsBySelector() method​ returns a collection of elements matching a specified selector.
question
true
answer
T/F Internet Explorer 8 does not support the textContent property.​
question
True
answer
T/F node attached with the appendChild() method is always added as the last child element of the parent element.​
question
options
answer
When you open a new web browser window, you can customize its appearance using the ____ argument of the window.open() method.
question
focus()
answer
In order to make a window the active window, you use the ____ method of the Window object.
question
setTimeout();
answer
The ____ method is used in JavaScript to execute code after a specific amount of time has elapsed.
question
clearTimeout();
answer
The ____ method is used to cancel a setTimeout() method before its code executes.
question
setInterval()
answer
The ____ method repeatedly executes the same code after being called only once.
question
clearInterval()
answer
The ____ method is used to clear a setInterval() method call.
question
length
answer
The History object contains a single property, the ____ property, which contains the specific number of documents that have been opened during the current browser session.
question
location
answer
The ____ object allows you to change to a new web page from within JavaScript code.
question
Navigator
answer
The ____ object is used to obtain information about the current web browser.
question
getElementsByClassName()
answer
Which method does NOT return a node list or HTML collection?​ a. getElementById() b. ​getElementsByTagName() c. ​getElementsByClassName() d. ​getElementsByName()
question
getElementsByTagName("h1")
answer
Which method returns all h1 elements in a document?​
question
querySelector("p figure img")
answer
Which method returns all elements in a document that match the selector p figure img?​
question
​fontFamily
answer
Which is the correct way to reference the CSS font-family property in JavaScript when using dot notation?​
question
document.getElementById("homeLink").href
answer
Which is the correct way to reference the href attribute of the element with the id value homeLink?​
question
createElement()
answer
Which results in a node that exists independently of the DOM tree?​
question
inserBefore()
answer
Which method adds a node to a parent node before one or more existing child nodes?​
question
the ​DOM tree
answer
The DOM hierarchy is also known as ____.
question
getElementsByClassName("first")
answer
Which method returns the element created by the HTML tag pair

?
question
querySelector()
answer
Which method returns a single element?​
question
document fragment​
answer
A set of connected nodes that are not part of a document is known as a(n) ____.​
question
window
answer
The ____________________ object represents a web browser window.
question
document object model
answer
The Document object branch of the browser object model is represented by its own object model called the ______________________________.
question
self
answer
One way of referring to the Window object is by using the ____________________ property, which refers to the current Window object.
question
textContent
answer
For security reasons, you should use the ____________________ property when possible instead of the innerHTML property.​
question
node
answer
Each item in the DOM tree is known as a(n) ____________________.​
question
the windoe object represents the browser window. It's related to the document object because the web page is diplayedin it. The window is the parent object of all other objects.
answer
Explain the relationship between the Window object and the Document object.
question
getElementsbyTagName(h2); getElementsByClassName(seciont); querySelector("h2 section);
answer
The first h2 element in a web page is created with the following tag pair:

. Provide three different examples of code to reference this element using three different methods.
question
inner HTML allows you to acces adn write HTML tags along with text, while text Content strips these out. Text conent strips out striclty the text and leaves out the code.
answer
What is the difference between the content accessed by the textContent and innerHTML properties?
question
reference an attribute of an element document.getElementById( "homelink) reference CSS propery of element getElementByID("logo:).style.fontFamily;
answer
What is the difference in syntax between referencing a CSS property of an element and referencing an attribute of an element? Give an example of each.
question
appendChild() is the most basic bitch of all of them. Adds node as a child of a parent node that is specified. Always appended after any existing childing nodes. Use insertBefore() when you need to place it in a specific place among existing bitches.
answer
Name two ways to add a node to the DOM, and explain when you'd use each.
question
through thigns like openWin whcih is created by the values specified in the windows.open() method.
answer
How can you control a new window from the browser window that created it?
question
SetTImeout () executes code after a specific amount of time has elapse. It's sister function is clearTimeout() The setInterval repeatedly executes code after an amount of time has passed. it's sister function is clearInterval.
answer
Describe the differences between the setTimeout() and setInterval() methods, and specify the method you use to cancel each.
question
No. The information is private. It's an essential security feature.
answer
Can you use JavaScript access URLs contained in the History object? If yes, provide code to do so. If no, why not?
question
Rarely because javascript implementations are standardized across the current versions of all major browsers. Browser can be challenging to get conclusive information. Developers instead use browser detection capabilities built into libraries.
answer
Is the Navigator object commonly used in determining which type of browser a user is running? Why or why not?
question
Assign values to the left and top options of the options argument. Subtract width of window from screen width and divide the remainder by two, and assign resut to left option. Same goes for vertical window. Subtract height of the window from screen height, divide remaining by two, and assign reult to top option.
answer
How can you center a web browser window in the middle of the display area?