how to set replace an element with other in JQuery code example Example: jquery replace element $("elementsSelector").replaceWith( "<h2>New content</h2>" );