Where is the jQuery data method information located?
Can i do
<div class="some_div">some div</div>
<script>
jQuery('.some_div').data('some_data','some info').remove();
</script>
where is the information added by the data method still around the DOM? Do I need to uninitialize? Is the information automatically deleted when the div element has no links?
+3
2 answers
Data is stored in a variable accessible to jQuery objects through closure. It is never saved in dom. The delete method deletes data along with the DOM element.
.remove ([selector])
.empty(),.remove() DOM. .remove(), , . , jQuery, .
source: jQuery API: remove()
+4