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 addClass() Multiple Classes</title> <style> body { font-family: Arial, sans-serif; padding: 40px; background-color: #f2f2f2; } .box { width: 200px; height: 100px; line-height: 100px; text-align: center; margin-top: 20px; background-color: #ddd; border: 1px solid #ccc; border-radius: 4px; transition: all 0.3s ease; } .rounded { border-radius: 20px; } shadow { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); } .bg-orange { background-color: orange; color: white; } button { padding: 10px 20px; background-color: #2196F3; color: white; border: none; border-radius: 4px; cursor: pointer; margin-top: 10px; } </style> <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> </head> <body> <h1>jQuery addClass() – Multiple Classes</h1> <p>Click the button to add multiple CSS classes to the box below.</p> <div class="box" id="myBox">Hello!</div> <button id="addClassesBtn">Add Multiple Classes</button> <script> $(document).ready(function(){ $('#addClassesBtn').click(function(){ $('#myBox').addClass('rounded bg-orange shadow'); }); }); </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