JSX className vs class
Multiple Choice Easy
Question
In JSX, how do you specify a CSS class for an element?
Hint
JSX is JavaScript, and class is a reserved word in JS.
Explanation
Since JSX is JavaScript and class is a reserved keyword, you must use className instead of class to specify CSS classes in JSX.
Related Resources
Related Lessons
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.