I've a jQuery object (counts) like this :
Object {men: 299, womens: 175, children: 173}
I just want to retrieve the value to display it in a span (the data-filter attributes are the same as the object keys)
$( "a.type_select" ).each(function() {
var theType = $(this).attr('data-filter');
var theCounter = counts.theType;
$(this).children('span.count').html(' ('+theCounter+')');
});
How can I do this ?
Thanks !