//html structure
<div id='outer'>
<div id='inner'>
</div>
</div>
I am adding some data to inner element like
$('#inner').data('_key','_someValue');
Now some time in future, I am clearing text of outer element.
$('#outer').empty().html('some thing new');
I am clearing div's text using empty()
, I read that empty()
removes all events bound on children elements.
My question is, doe the empty function also remove data from element or we have to do it ourselves like $('#inner').data('_key',null)
before removing element from DOM or its done automatically by empty()
.