id Attribute
id attribute defines a unique id for an element. id attribute can be used on any HTML element. It is a global attribute.
Example:
<!DOCTYPE html>
<html>
<head>
<title>
Page Title
</title>
</head>
<body>
<h1>
This is id attribute example.
</h1>
<h1 id="unique"> id attribute
</h1>
</body>
</html>
Run Example
Browser Support
Attribute |
Firefox |
Chrome |
IE |
Opera |
Safari |
id |
yes |
yes |
yes |
yes |
yes |