Exam 5: Working With the Document Object Model Dom and Dhtml
A node attached with the appendChild()method is always added as the last child element of the parent element.
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.
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?
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.
The ____ method is used in JavaScript to execute code after a specific amount of time has elapsed.
Which method returns the element created by the HTML tag pair <p id="weekend" class="first">P1P1_E?
Name two ways to add a node to the DOM, and explain when you'd use each.
How can you control a new window from the browser window that created it?
The ____ object is used to obtain information about the current web browser.
The ____ method repeatedly executes the same code after being called only once.
Is the Navigator object commonly used in determining which type of browser a user is running? Why or why not?
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.
The getElementsBySelector()method returns a collection of elements matching a specified selector.
Explain the relationship between the Window object and the Document object.
Which is the correct way to reference the CSS font-family property in JavaScript when using dot notation?
Which method adds a node to a parent node before one or more existing child nodes?
When you open a new web browser window, you can customize its appearance using the ____ argument of the window.open()method.
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)