Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var divClone = $("#some_div").clone(); // Do this on $(document).ready(function() { ... })
- $("#some_div").html("Yeah all good mate!"); // Change the content temporarily
- // Use this command if you want to keep divClone as a copy of "#some_div"
- $("#some_div").replaceWith(divClone.clone()); // Restore element with a copy of divClone
- // Any changes to "#some_div" after this point will affect the value of divClone
- $("#some_div").replaceWith(divClone);
Advertisement
Add Comment
Please, Sign In to add comment