The method getElementById selects an element using its ______.

  • ID
  • Tag Name
  • Class Name
  • Attribute
The method getElementById selects an element by its ID attribute. It returns the element with the specified ID attribute, providing a direct and efficient way to access an element in the DOM by its unique identifier.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *