nerdexam
Microsoft

98-375 · Question #58

You are creating a page by using HTML5. You add script tags to the page. You need to use JavaScript to access an element by id and add a class to the element. Which property or attribute should you…

The correct answer is B. the className property. See the full explanation below for the reasoning.

Question

You are creating a page by using HTML5. You add script tags to the page. You need to use JavaScript to access an element by id and add a class to the element. Which property or attribute should you use?

Options

  • Athe tagName property
  • Bthe className property
  • Cthe style property
  • Dthe class attribute

How the community answered

(28 responses)
  • A
    7% (2)
  • B
    79% (22)
  • C
    11% (3)
  • D
    4% (1)

Community Discussion

No community discussion yet for this question.

Full 98-375 Practice