jquery replace element
snippet in javascript

jquery replace element

user6095

$("elementsSelector").replaceWith( "<h2>New content</h2>" );

jquery replace html

user7295

$(element).html("Hello World");

jqueryreplace content of div

user4737

$('#content-container').html(linkText);