Title:
JavaScript DOM Objects Worksheet
Updated:
November 16, 2023
Task/Activity:
- Questions
- JS Coding Problems
Essentially an element of data within the document object. Every attribute, element, and text is a node.
- In order to use the document.getElementById() method to 'get a handle' on an element, what attribute must that element have?
It must have an id attribute.
- When you invoke document.getElementById(), you must pass in a string parameter. What does the parameter represent?
That parameter represents the id that you are looking for.
- What does the document.getElementById() method return?
It returns the HTML element that is identified by that id.
- What object is at the top of the DOM? In other words, what DOM object contains all other DOM objects?
I'm uncertain as to whether you are referring to the document node or the window, but the window is above the document.