Browsers that support Id attribute:
- Google Chrome
- Internet Explorer
Note: In HTML5, id attributes can be used by any HTML tag but in HTML 4.01 there are some restriction to use id attributes. It can not be used by <base>, <head>, <html>, <meta>, <param>, <script>, <style>, and <title> tag. In HTML4.01 id can not start with number.
Difference between id and class:
- HTML page contains multiple element with same class but id is unique, only single id exist in single page.
- HTML class use ‘.’ character before the name of the class while id use ‘#’ character before the name of the in CSS.
- HTML | Attributes
- HTML | data-* Attributes
- HTML | DOM attributes Property
- jQuery | Set Content and Attributes
- jQuery | Get Content and Attributes
- HTML Course | Structure of an HTML Document
- HTML | DOM HTML Object
- HTML Course | Basics of HTML
- HTML | <html> Tag
- HTML | <del> Tag
- HTML | <kbd> Tag
- HTML | <i> Tag
- HTML <ins> Tag
- HTML | col Tag
- Div Tag | HTML
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.