Web.QHMIT
.com
Toggle navigation
☰
Home
HTML
CSS
Scripting
Database
Run
<!doctype html> <title>Example</title> <style> div { background: limegreen; color: white; padding: 10px; margin: 20px; } .different { border: 5px solid orange; background: gold; color: black; } </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script> $( function() { $( "div" ).click( function() { $( this ).toggleClass( "different" ); }); }); </script> <div> Click me... </div> <div class="different"> No, click me! </div>
Preview