Q. Which attribute is used in React to give CSS classes?

  • (A) class
  • (B) className
  • (C) css
  • (D) styleName
πŸ’¬ Discuss
βœ… Correct Answer: (B) className
Explanation: In JSX, 'className' is used instead of 'class' to avoid conflicts with JavaScript reserved keywords.
Explanation by: Mr. Dubey
In JSX, 'className' is used instead of 'class' to avoid conflicts with JavaScript reserved keywords.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
63
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
83%
Success Rate