【发布时间】:2014-08-10 11:16:54
【问题描述】:
我有一个像这样的 jQuery 对象(计数):
Object {men: 299, womens: 175, children: 173}
我只是想检索值以在跨度中显示(数据过滤器属性与对象键相同)
$( "a.type_select" ).each(function() {
var theType = $(this).attr('data-filter');
var theCounter = counts.theType;
$(this).children('span.count').html(' ('+theCounter+')');
});
我该怎么做?
谢谢!
【问题讨论】: