JQuery Multiple Prepend

 

In this example,prepend() method is used to Inserts multiple content at the start of the selected elements. We can take an infinite number of new elements as parameters.

 
 
 
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script> <script> $(document).ready(function(){ $(".btn1").click(function(){ $("div").prepend("Appwrk."); }); }); </script> </head> <body> <div>jquery</div> <div>javascript</div> <div>ASP.net</div> <button class="btn1">prepend text</button> </body> </html>
Output