Question

Answer Here

2. How will you select HTML elements using DOM? Name the DOM methods.

Ans: We can select html elements in 4 way using DOM.

They Are:

  1. getElementById() method.
  2. getElementsByClassName() method.
  3. getElementsByTagName() method.
  4. querySelector() & querySelectorAll() method.