id attribute

id=id

Explanation

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

Example Code:

Result :

Welcome

  • 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.

Limitations:

It is applicable to all major browsers.

Ask Questions

Ask Question