Manipulating Elements | jQuery Learning Center

PHOTO EMBED

Sat May 29 2021 01:49:40 GMT+0000 (Coordinated Universal Time)

Saved by @ejiwen

// Getting a new element on to the page.
 
var myNewElement = $( "<p>New element</p>" );
 
myNewElement.appendTo( "#content" );
 
myNewElement.insertAfter( "ul:last" ); // This will remove the p from #content!
 
$( "ul" ).last().after( myNewElement.clone() ); // Clone the p so now we have two.
content_copyCOPY

Creating New Elements

https://learn.jquery.com/using-jquery-core/manipulating-elements/