143k views
13 votes
1. what is the purpose of giving an id to an html element when using javascript?

1 Answer

4 votes

Answer:

It is also used by JavaScript to access and manipulate the element with the specific id.

User Chris Holwerda
by
5.5k points