The class attribute is often used to point to a class name in a style sheet. It can also be used by a JavaScript to access and manipulate elements with the specific class name.
In the following example, we have three <div> elements with a class attribute with the value of "city".
All of the three <div> elements will be styled equally according to the .city style definition in the head section: