Each element on a web page can have only one ID attribute, and each page can only have one element with that ID.

When you are first starting out in web design and development, this is something that you will hear time and time again. You should never use an ID more than once in any instance on an element or each web page.

Code that has multiple IDs that are the same on one page will not pass validation.

Furthermore, when you add more functionality using JavaScript, and you are trying to get the value of an element with a specific ID, you will run into issues and this could create bugs on your web page or web app.

IDs also have a special functionality that is not available with classes, and that is when they are used with hash values in a URL.

Classes, on the other hand, are not unique, and you can use the same class on multiple elements, and you can also add multiple classes to the same element.

This is really useful, because it means any styling information that needs to be applied to multiple objects on a page can be done with just one class.

This means that in your CSS, you create style declarations under that name and when you add that class as an attribute to any element on the web page, it will have that styling applied to it.