Toggle Classes

Add and remove CSS classes dynamically
Toggle classes to create interactive UI elements with smooth transitions and visual feedback.
toggle classes CSS
Click the button!

The Code

<div id="box" class="demo-box"> Click the button! </div> <button _="on click toggle .active on #box"> Toggle Active State </button> /* CSS */ .demo-box.active { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; transform: scale(1.1) rotate(5deg); }

How it works:

Other Toggle Commands:

Try it yourself: