Exam 5: Working With the Document Object Model Dom and Dhtml

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

A node attached with the appendChild()method is always added as the last child element of the parent element.

Free
(True/False)
4.9/5
(33)
Correct Answer:
Verified

True

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.

Free
(Essay)
4.9/5
(45)
Correct Answer:
Verified

To access and change an element's CSS properties through the DOM, you  use dot notation to reference the element's style property followed by the name of the CSS  property. The following code references an element's display property:
document .getElementById() "logo" .style.display
To access and change an element's attributes through the DOM,  you use dot syntax by adding a period  and the name of the attribute after the element reference. The following code references an element's left property:
document .getElementById() "logo" .left

How can you center a web browser window in the middle of the display area?

Free
(Essay)
5.0/5
(33)
Correct Answer:
Verified

One of the more common uses of the Screen object properties is to center a web browser window in the middle of the display area. For windows generated with the window.open() method, you can center a window when it first displays by assigning values to the left and top options of the options argument. To center a window horizontally, subtract the width of the window from the screen width, divide the remainder by two, and assign the result to the left option. Similarly, to center a window vertically, subtract the height of the window from the screen height, divide the remainder by two, and assign the result to the top option.

Internet Explorer 8 does not support the textContent property.

(True/False)
4.9/5
(42)

The ____ method is used in JavaScript to execute code after a specific amount of time has elapsed.

(Multiple Choice)
4.8/5
(30)

Which method returns the element created by the HTML tag pair <p id="weekend" class="first">P1P1_E?

(Multiple Choice)
4.8/5
(40)

Which method returns a single element?

(Multiple Choice)
5.0/5
(35)

Name two ways to add a node to the DOM, and explain when you'd use each.

(Essay)
4.9/5
(39)

The DOM hierarchy is also known as ____.

(Multiple Choice)
4.7/5
(28)

How can you control a new window from the browser window that created it?

(Essay)
4.9/5
(47)

The ____ object is used to obtain information about the current web browser.

(Multiple Choice)
4.8/5
(33)

The ____ method repeatedly executes the same code after being called only once.

(Multiple Choice)
4.8/5
(31)

Is the Navigator object commonly used in determining which type of browser a user is running? Why or why not?

(Essay)
4.9/5
(38)

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.

(Multiple Choice)
4.8/5
(40)

The getElementsBySelector()method returns a collection of elements matching a specified selector.

(True/False)
4.9/5
(31)

Explain the relationship between the Window object and the  Document object.

(Essay)
4.9/5
(30)

Which is the correct way to reference the CSS  font-family property in JavaScript when using dot notation?

(Multiple Choice)
4.8/5
(43)

Which method adds a node to a parent node before one or more existing child nodes?

(Multiple Choice)
4.8/5
(45)
Match each statement below with correct item :
Represents the web page displayed in the browser
HTML collection
Attaches a node to the DOM tree
getElementsByClassName() method
References elements using the syntax of CSS
client-side object model
Correct Answer:
Verified
Premises:
Responses:
Represents the web page displayed in the browser
HTML collection
Attaches a node to the DOM tree
getElementsByClassName() method
References elements using the syntax of CSS
client-side object model
References elements using the value of the HTML class attribute
node
Closes the current window
document fragment
Nodes that are not part of a document
self.close()
Maintains an internal list of all the documents that have been opened during the current web browser session
querySelectorAll() method
Also known as the browser object model (BOM)
History object
Indexed collection of HTML elements
Document object
Each item in the DOM tree
appendChild method
(Matching)
4.7/5
(37)

When you open a new web browser window, you can customize its appearance using the ____ argument of the window.open()method.

(Multiple Choice)
4.8/5
(38)
Showing 1 - 20 of 41
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)