id attribute



ID attribute indicates sole id for an element. It helps to handle/control the text combined with javascript in a webpage.
Values added with this attribute are:
idid for an input. Should begin with capital or small letter.

Example Code:

Result :


  • Click the button to view the id for an element.
  • JavaScript can be utilized with this attribute to perform corrections in an element.
  • It wont function, if it is included with elements like "base, head, html, meta, param, script, style, and title".
It is supported by the all the elements in HTML5 & it is available in the earlier versions of the HTML.


It is applicable to all major browsers.

Ask Questions

Ask Question