JQuery Append

 

The append() method inserts specified content at the end of the selected elements. In this example we are inserting HTML contents at the end of the element.

Syntax: $(selector).append(content,function(index,html))

 
 
 
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script> <script> $(document).ready(function(){ $("p").append(' <a href="class">read more something about Appwrk...</a>'); $("button").click(function(){ $(".cross").append("<h2>get the Appwrk information.</h2>"); }); }); </script> </head> <body> <button type="button">Insert Text</button> <div class="cross"> <p style="color:chartreuse; font-size: larger">APPWRK IT Solutions is a complete Web Solutions Company offering customer-oriented web design services and more importantly, deliver them effectively.</p> <p style="color:maroon; font-size: larger">We are breathing in a planet where almost everything adjacent to us is technology driven. </p> </div> </body> </html>
Output