New course! Every coder should learn Generative AI!
Try a free lesson+ 8
Definition and Usage. The class attribute specifies one or more classnames for an element. The class attribute is mostly used to point to a class in a style sheet. However, it can also be used by a JavaScript (via the HTML DOM) to make changes to HTMLelements with a specified class.