jquery replace string in element code example
Example 1: jquery replace element
$("elementsSelector").replaceWith( "<h2>New content</h2>" );
Example 2: replace jquery
$("p:first").replaceWith("Hello world!");
$("elementsSelector").replaceWith( "<h2>New content</h2>" );
$("p:first").replaceWith("Hello world!");