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() Method</title> <style> body { font-family: Arial, sans-serif; padding: 40px; background-color: #f9f9f9; } h1 { color: #333; } p { font-size: 16px; color: #444; } .content-box { padding: 20px; background-color: #fff; border: 1px solid #ccc; border-radius: 6px; margin-top: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); } .highlight-box { background-color: #E3F2FD; padding: 15px; border: 2px dashed #2196F3; border-radius: 6px; color: #0D47A1; margin-bottom: 15px; } .highlight-box.active { background-color: #FFEBEE; border-color: #E53935; color: #B71C1C; } button { margin-top: 15px; padding: 10px 20px; background-color: #2196F3; color: white; font-size: 14px; border: none; border-radius: 4px; cursor: pointer; } button:hover { background-color: #1976D2; } </style> </head> <body> <h1>jQuery removeClass() Method</h1> <p> The <code>removeClass()</code> method removes one or more class names from the selected elements. In this example, we remove the <code>active</code> class from a styled box. </p> <div class="content-box"> <div class="highlight-box active" id="myBox"> I have the <code>active</code> class applied. </div> <button id="removeClassBtn">Remove "active" Class</button> </div> <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> <script> $(document).ready(function() { $('#removeClassBtn').click(function() { $('#myBox').removeClass('active').text('The "active" class has been removed.'); }); }); </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