What is the class attribute?

what is the use of class atrribute

I don’t know much about HTML 5 but I’m pretty sure it comes into play when you start including Javascript code into a website. Sorry if this answer isn’t very informative, that’s about as far as I know.

1 Like

See this lesson from CodeCademy: https://www.codecademy.com/courses/learn-css/lessons/css-setup-selectors/exercises/class-name

1 Like

I think the class attribute is for styling and selecting multiple elements by class attribute via JavaScript.

You can also use it in CSS.

1 Like

For anyone wondering, you should learn the purpose of class later in the course. (Unless you’re in the learn HTML course)

class is used in CSS and JS where you can select different things within a class and tell them to do things.


thanks for the explanation. Going to be learning JS very soon!