Codelab Editor
Free Online HTML Editor
Run
Learn jQuery
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>jQuery Move With appendTo() Method</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <style> body { font-family: Arial, sans-serif; padding: 30px; background: #f9f9f9; } #container { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; } .box { width: 80px; height: 80px; background: #4CAF50; color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; border-radius: 4px; } button { padding: 10px 20px; background: #007BFF; color: white; border: none; border-radius: 4px; cursor: pointer; } </style> </head> <body> <h2>jQuery Move With appendTo() Method</h2> <p>The <code>appendTo()</code> method allows you to move existing elements into a new container or position in the DOM structure.</p> <div id="container"> <div class="box" style="background: red;">A</div> <div class="box">B</div> <div class="box">C</div> <div class="box">D</div> </div> <button id="reorderBoxes">Move First Box to End</button> <script> $(document).ready(function(){ $("#reorderBoxes").click(function(){ $(".box:first").appendTo("#container"); }); }); </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