Which JavaScript method is used to access an HTML element by id?

9. Which JavaScript method is used to access an HTML element by id?

  1. getElementById()
  2. getElement(id)
  3. getElementById(id)
  4. elementById(id)

Answer: C) getElementById(id)

Explanation:

The JavaScript method document.getElementById(id) is used to access an HTML document by id.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.