Web.QHMIT
.com
Toggle navigation
☰
Home
HTML
CSS
Scripting
Database
Run
<!DOCTYPE html> <title>My 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 ).addClass( "different" ); }); }); </script> <div> Click me... </div> <div> No, click me! </div>
Preview