Is it possible to loop through a data() object?
Suppose this is my code:
$(\'#mydiv\').data(\'bar\',\'lorem\');
$(\'#mydiv\').data(\'f
I just tried this but needed some extra data values. If you also got this "problem" then the following should work.
$('#mydiv').data('bar', {name:'lorem', id:'156', price:'199'});
then you can simply extend with the value id
$.each( $('#mydiv').data(),function(i, e) {
alert('name='+ i + ' name=' +e.name + ' id='e.id + ' price=' + e.price );
});