Microsoft
98-375 · Question #29
You need to use JavaScript to access the "section1" element in the following code fragment: <div id='section1'> Which method should you use?
The correct answer is B. getElementById. See the full explanation below for the reasoning.
Question
You need to use JavaScript to access the "section1" element in the following code fragment:
<div id='section1'> Which method should you use?Options
- AgetElementsByTagName
- BgetElementById
- CgetElementsByName
- DgetElementsByClassName
How the community answered
(56 responses)- A9% (5)
- B73% (41)
- C4% (2)
- D14% (8)
Community Discussion
No community discussion yet for this question.