我想检查使用复选框组,每个复选框都有一个开始时间和结束时间,我想在我尝试检查时检查当前复选框,jquery会检查当前时间是否在其他复选框中为开始和结束时间或不?这是我的尝试:
function checkcurrentgroup(g,t)
{
//alert(g); is the group id
//alert(t); is the checkbox current time (start time)
if($(':checkbox.' + g + ':checked').length > 0)
{
$(':checkbox.' + g + ':checked').each(function(i,e){
/*I don't know the code in here */
});
}
}
这是html代码:
<tr>
<td><input type="checkbox" class="ids-1" id="ids-1" data-name="ids-1" value="ids-1-val" /></td>
<td><input type="hidden" id="start" name="start" value="start1"/></td>
<td><input type="hidden" id="end" name="end" value="start1"/></td>
</tr>
<tr>
<td><input type="checkbox" class="ids-1" id="ids-1" data-name="ids-1" value="ids-1-val" /></td>
<td><input type="hidden" id="start" name="start" value="start1"/></td>
<td><input type="hidden" id="end" name="end" value="start1"/></td>
</tr>
<tr>
<td><input type="checkbox" class="ids-2" id="ids-2" data-name="ids-2" value="ids-2-val" /></td>
<td><input type="hidden" id="start" name="start" value="start2"/></td>
<td><input type="hidden" id="end" name="end" value="start2"/></td>
</tr>
<tr>
<td><input type="checkbox" class="ids-2" id="ids-2" data-name="ids-2" value="ids-2-val" /></td>
<td><input type="hidden" id="start" name="start" value="start2"/></td>
<td><input type="hidden" id="end" name="end" value="start2"/></td>
</tr>
<tr>
<td><input type="checkbox" class="ids-3" id="ids-3" data-name="ids-3" value="ids-3-val" /></td>
<td><input type="hidden" id="start" name="start" value="start3"/></td>
<td><input type="hidden" id="end" name="end" value="start3"/></td>
</tr>
<tr>
<td><input type="checkbox" class="ids-3" id="ids-3" data-name="ids-3" value="ids-3-val" /></td>
<td><input type="hidden" id="start" name="start" value="start3"/></td>
<td><input type="hidden" id="end" name="end" value="start3"/></td>
</tr>