title: What sort of memory leaks should I watch for with jQuery's data()?
body: <p>Should I pair every data() call with a later removeData() call?</p>
  
  <p>My assumptions: jQuery's remove() will remove elements from the DOM, and if I don't have any other references to remove, I don't have to do any more clean up.</p>
  
  <p>However, if I have some javascript var or object referring to one of the elements being removed, I'll need to clean that up, and I'm assuming <strong>that applies to jQuery's data function, too,</strong> because it's referencing the elements somehow. </p>
  
  <p>So if I do need to call removeData before remove, is there a shortcut to remove all data associated with an element or do I have to call each explicitly by name?</p>
  
  <p>Edit: I looked through the source code and confirmed what Borgar and roosteronacid said. Remove takes the elements out of the dom and deletes any events and data stored with them - which is convenient, but makes me wonder when you would use removeData(). Probably not often.</p>