Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>jQuery DOM Manipulation</title> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> </head> <body> <div id="container"> <p>Initial Paragraph</p> </div> <button id="add-content">Add Content</button> <script> $(document).ready(function(){ $("#add-content").click(function(){ $("#container").append("<p>New Paragraph</p>"); }); }); </script> </body> </html>