JQuery prepend_add html heading

 

In this example we will show you how to add a HTML heading to the beginning of a paragraph element using the jQuery prepend() method.

 
 
 
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("p").prepend("<h1>APPWRK IT Solutions is a complete Web Solutions Company offering customer-oriented web design services and more importantly, deliver them effectively.</h1>"); }); }); </script> </head> <body> <p style="color:indigo; font-size:20px">We are breathing in a planet where almost everything adjacent to us is technology driven. </p> <button>Add Appwrk Heading</button> </body> </html>
Output