価格のチェックボックスがたくさんありますが、私が試したことは次のとおりです。
誰かが価格/チェックボックスを選択すると、選択した値よりも小さい値が自動的にチェックされます。
HTML
<div class="prices">
<input type="checkbox" value="59.99" />59.99
<input type="checkbox" value="69.99" />69.99
<input type="checkbox" value="79.99" />79.99
<input type="checkbox" value="89.99" />89.99
<input type="checkbox" value="99.99" />99.99
<input type="checkbox" value="124.99" />124.99
<input type="checkbox" value="149.99" />149.99
<input type="checkbox" value="199.99" />199.99
<input type="checkbox" value="200.00" />200.00
</div>
JQUERY
$('.prices input[type=checkbox]').live('click', function (){
console.log(this);
$(this).attr('checked', true);
var chosenPrice = $(this).val();
console.log(chosenPrice);
$(".prices input").filter(function(){
return $(this).attr("value") <=chosenPrice}).attr('checked', true);
});
いくつかの値を選択しますが、正常に機能していないようです。フィドルをチェックしてください