我有 7 个复选框用于选择日期。例如:
<span><input name="days" type="checkbox" value="1" id="day1"><label for="day1">M</label></span>
<span><input name="days" type="checkbox" value="2" id="day2"><label for="day2">T</label></span>
<span><input name="days" type="checkbox" value="3" id="day3"><label for="day3">W</label></span>
<span><input name="days" type="checkbox" value="4" id="day4"><label for="day4">T</label></span>
<span><input name="days" type="checkbox" value="5" id="day5"><label for="day5">F</label></span>
<span><input name="days" type="checkbox" value="6" id="day6"><label for="day6">S</label></span>
<span><input name="days" type="checkbox" value="7" id="day7"><label for="day7">S</label></span>
我也有一个数组:
var selectedDays = ["5","6"];
我想在第 5 天和第 6 天进行负载选择。有什么捷径可以做到这一点吗?