ExamVeda
Login
Home
41
The central object in a larger API is known as
Discuss
Answer & Solution
Answer: Option B
Solution:
The Document object does not stand alone, however. It is the central object in a larger API, known as the Document Object Model, or DOM, for representing and manipulating document content.
42
The paragraph “p” is a part of
Discuss
Answer & Solution
Answer: Option D
Solution:
The paragraph tag belongs to both html and body tags.
43
The node directly above a node is called
Discuss
Answer & Solution
Answer: Option C
Solution:
The node directly above a node is the parent of that node.
44
The Text and Comment is part of
Discuss
Answer & Solution
Answer: Option A
Solution:
The Text and Comment is part of the CharacterData Element.
45
The nodes that represent HTML elements are the
Discuss
Answer & Solution
Answer: Option D
Solution:
The nodes that represent HTML elements are Element nodes.
46
Which of the following is/are of Text nodes?
Discuss
Answer & Solution
Answer: Option C
Solution:
Both Text and Comment are basically strings of text, and these nodes are much like the Text nodes that represent the displaying text of a document.
47
Which is one of way to query a document for an element or elements?
Discuss
Answer & Solution
Answer: Option D
Solution:
he DOM defines a number of ways to select elements; you can query a document for an element or elements:
1. with a specified id attribute;
2. with a specified name attribute;
3. with the specified tag name;
4. with the specified CSS class or classes; or
5. matching the specified CSS selector
48
Which of the following can be used to select HTML elements based on the value of their name attributes?
Discuss
Answer & Solution
Answer: Option B
Solution:
To select HTML elements based on the value of their name attributes, you can use the getElementsByName() method of the Document object:
var radiobuttons = document.getElementsByName("favorite_color");
49
Which of the following property refers to the root element of the document?
Discuss
Answer & Solution
Answer: Option A
Solution:
The documentElement property of the Document class refers to the root element of the document. This is always an HTML element.
50
The return type of getElementsByClassName() is
Discuss
Answer & Solution
Answer: Option D
Solution:
Like getElementsByTagName(), getElementsByClassName() can be invoked on both HTML documents and HTML elements, and it returns a live NodeList containing all matching descendants of the document or element.