Q. Which DOM method selects an element by its ID?

  • (A) document.getElementById()
  • (B) document.querySelectorAll()
  • (C) document.getElementByClass()
  • (D) document.findById()
πŸ’¬ Discuss
βœ… Correct Answer: (A) document.getElementById()
Explanation: getElementById returns a reference to the element with specified ID.
Explanation by: Mr. Dubey
getElementById returns a reference to the element with specified ID.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
71
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
80%
Success Rate