repolace html jaquery

$( "div.second" ).replaceWith( "<h2>New heading</h2>" );
Panicky Peafowl