jQuery Add Elements
<!DOCTYPE html> <html> <head> <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> </head> <body> <ul id="todo"> <li>Write code</li> </ul> <script> $(document).ready(function() { $("#todo").append("<li>Test code</li>"); $("#todo").prepend("<li>Plan the feature</li>"); // Order is now: Plan the feature, Write code, Test code }); </script> </body> </html>