I have some data on the div elements, which I then remove from dom at some point (and push to array) and reinsert later int to the dom, but the data gets lost. Is there a way to preserve this data for later when I reinsert it into the dom. Its not just one or two data-attributes I could create in html, but little more than that.
I am removing elements from dom the following way:
arr = [];
playlistContent.find('.box').each(function(){
arr.push($(this));
})
playlistContent.empty();//remove also some other elements present in there