elibraryportal Logo

HTML ID

⟼. Id Attribute is same work like class. but where ID is use # symbol.

See in Example:

Output:-

This is first heading use of id elements


id Attribute use in JavaScript

JavaScript can access an element with a specified id by using the getElementById() method:

Example:-

Output:-

Hello World!

Next TopicHTML Div Tag