Codelab Editor
Free Online HTML Editor
Run
Learn jQuery
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <title>jQuery removeClass() on Multiple Elements</title> <style> body { font-family: Arial, sans-serif; padding: 40px; background-color: #f5f5f5; } h1 { color: #333; } .box1, .box2, .box3 { width: 100px; height: 100px; background-color: #ccc; margin: 10px; display: inline-block; border-radius: 4px; transition: all 0.3s ease; box-shadow: none; } .highlight { background-color: #FF9800; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); transform: scale(1.1); } button { margin-top: 20px; padding: 10px 20px; background-color: #d32f2f; color: #fff; border: none; border-radius: 4px; cursor: pointer; } button:hover { background-color: #b71c1c; } </style> <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> </head> <body> <h1>Remove Class from Multiple Elements</h1> <p>The following example removes a CSS class from several elements at once. Each box starts with a highlighted background and shadow, which are removed on button click.</p> <div class="box1 highlight"></div> <div class="box2 highlight"></div> <div class="box3 highlight"></div> <br/> <button id="removeHighlightBtn">Remove Highlight</button> <script> $(document).ready(function(){ $('#removeHighlightBtn').click(function(){ $('.box1, .box2, .box3').removeClass('highlight'); }); }); </script> </body> </html>
Editor Commands
Ctrl
F
Find
Ctrl
G
Find Next
Ctrl
⇧
G
Find Previous
Ctrl
⇧
F
Find & Replace
Ctrl
]
Indent Code Right
Ctrl
[
Indent Code Left
⇧
Tab
Auto Indent Code
Ctrl
/
Line Comment
Ctrl
Alt
/
Block Comment
TutsInsider Actions
Alt
S
Run Code
Ctrl
C
Copy Editor Code
Ctrl
A
Select All Editor Code
Ctrl
S
Save/Download
Ctrl
Alt
X
Rotate
Ctrl
Alt
T
Switch Theme
Ctrl
⇧
C
Open Console
Esc
Close Console