title: jQuery data() vs attr(data)
body: <p>I would like to know the difference between saving data to an element using <code>$(element).data({'foo' : 'bar'})</code> vs <code>$(element).attr({ 'data-foo' : 'bar' })</code>. And which of the two method would be best to use when saving a large amount of data in to an element? Thanks</p>