I removed a div using $(".className").remove() and I want to add it back
I tried the obvious, $(".className").add() but it doesn't get the job done. Any solutions?
If you want to put it back, then you have to store it somewhere. If you just remove it, then you are throwing it away.
let $savedClassName = $(".className");
$savedClassName.remove();
Then to put it back you need to say where you want to put it. e.g.
$("#parent").append($savedClassName);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With