JQuery Add with child nodes

 

In this example The clone() method makes a copy of selected elements, including child nodes, text and attributes.

 
 
 
<!doctype html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script> </head> <body> <p>Appwrk IT Solution</p> <script> $( "p" ).clone().add( "<span>LearnKode</span>" ).appendTo( document.body ); </script> </body> </html>
Output