0
我想获得一个页面来过滤页面上的不同参数适合住宿部分。我无法让过滤器一起工作,所以如果用户点击一个部分,它将与另一个部分一起工作。jquery多复选框过滤器
的小提琴是http://jsfiddle.net/ktcle/YEtgM/2/
感谢您的帮助
$('input').change(function(){
$('input').each(function(){
var checked = $(this).attr('checked') || false;
var numberofrooms = $(this).data('bedrooms');
var sitelocation = $(this).data('location');
$('li').each(function(){
if ($(this).data('bedrooms')==numberofrooms){
checked ? $(this).show() : $(this).hide();
}
if ($(this).data('location')==sitelocation){
checked ? $(this).show() : $(this).hide();
}
});
});
});
有什么理由你的投入没有名称和值的属性? – j08691
没有理由,这只是在测试,直到它的工作,然后我将它们添加在 –