423,271 views
12 votes
12 votes
1. what is the purpose of giving an id to an html element when using javascript?

User Abhijith Brumal
by
2.8k points

1 Answer

18 votes
18 votes

Answer:

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

User JensJensen
by
3.1k points