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 nextAll() – Get All Next Siblings</title> <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> <style> body { font-family: Arial, sans-serif; background: #f4f4f4; padding: 30px; } h2 { color: #333; } .description { color: #666; margin-bottom: 20px; } .container { border: 2px solid #ccc; background: #fff; padding: 20px; width: 400px; } .box { padding: 12px; margin: 8px 0; border: 1px solid #aaa; background: #e0f7fa; cursor: pointer; } .highlight { background: #ffe082; border-color: #ffa000; } </style> </head> <body> <h2>jQuery nextAll() – Highlight All Next Siblings</h2> <p class="description"> Click any box to highlight <strong>all boxes after it</strong> using the <kbd>nextAll()</kbd> method. </p> <div class="container"> <div class="box">Item 1</div> <div class="box">Item 2</div> <div class="box">Item 3</div> <div class="box">Item 4</div> <div class="box">Item 5</div> </div> <script> $(function () { $('.box').on('click', function () { $('.box').removeClass('highlight'); // Reset $(this).nextAll().addClass('highlight'); // Highlight all next siblings }); }); </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