Q. Which DOM method returns the first element that matches a selector?

  • (A) querySelector()
  • (B) querySelectorAll()
  • (C) getElementById()
  • (D) getElementsByTagName()
πŸ’¬ Discuss
βœ… Correct Answer: (A) querySelector()
Explanation: querySelector returns the first element matching a CSS selector.
Explanation by: Mr. Dubey
querySelector returns the first element matching a CSS selector.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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