Randomblue Randomblue - 1 year ago 108
jQuery Question

replaceWith() without deleting the original element

Is there a jQuery function similar to

to replace an element with a new element, without destroying the original element (simply hiding it).

Answer Source

you can do :

<div class="toReplace">your first content</div >
<div class="toReplace" style="display: none">your second content</div >

then in js :

$("button").click(function () {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download