Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery Add Elements to DOM</title> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("ol").append("<li>list item</li>"); }); }); </script> </head> <body> <button>Add new list item</button> <ol> <li>list item</li> <li>list item</li> <li>list item</li> </ol> </body> </html>