Web API Cookbook
Examples
About
Get the Book
Examples
CSS
Conditionally Setting a CSS Class
Recipe 17.5
Conditionally Setting a CSS Class
Code
JavaScript
element.
classList
.
toggle
(
'expanded'
, isExpanded);