How can I disable the previous checkbox and the next checkbox in a loop using jquery? Right Now I am disabling "this" to disable current checkbox but I would also like to disable the previous checkbox and the next checkbox as well.

```
var CurrentCoordinationTimesArray, CurrentAvailableTimesArray;

for (var i = 0; i < gAssessorEventsArray.length; i++) {
    if (gAssessorEventsArray[i].EventID == ev.EventID) {
        CurrentCoordinationTimesArray = gAssessorEventsArray[i].CoordinationTimes.split(';');
        alert(CurrentCoordinationTimesArray);

        for (var j = 0; j < CurrentCoordinationTimesArray.length; j++) {
            alert(CurrentCoordinationTimesArray[j]);
            $('#AvailableTimesTable input[type=checkbox]').each(function () {
                if ($(this).val() == (CurrentCoordinationTimesArray[j] + ';')) this.disabled = 'true';
            });
        }

        break;
    }
}

```

This is my HTML:

```
<table width="620px" cellspacing="5" id="AvailableTimesTable" style="margin-top: 5px;border: 1px solid black; background-color: #E2EFFF;">
    <tbody>
        <tr>
            <td class="LightBoxHeadingCell" colspan="4">Available Times :</td>
        </tr>
        <tr>
            <td style="color:green;" class="AvailableTimes">
                <input type="checkbox" value="08:00 AM - 09:00 AM;" name="AvailableTimesCheckboxes" disabled="">08:00 AM - 09:00 AM</td>
            <td style="color:blue;" class="AvailableTimes">
                <input type="checkbox" value="08:30 AM - 09:30 AM;" name="AvailableTimesCheckboxes">08:30 AM - 09:30 AM</td>
            <td style="color:green;" class="AvailableTimes">
                <input type="checkbox" value="09:00 AM - 10:00 AM;" name="AvailableTimesCheckboxes">09:00 AM - 10:00 AM</td>
            <td style="color:blue;" class="AvailableTimes">
                <input type="checkbox" value="09:30 AM - 10:30 AM;" name="AvailableTimesCheckboxes">09:30 AM - 10:30 AM</td>
        </tr>
        <tr>
            <td style="color:green;" class="AvailableTimes">
                <input type="checkbox" value="10:00 AM - 11:00 AM;" name="AvailableTimesCheckboxes" disabled="">10:00 AM - 11:00 AM</td>
            <td style="color:blue;" class="AvailableTimes">
                <input type="checkbox" value="10:30 AM - 11:30 AM;" name="AvailableTimesCheckboxes">10:30 AM - 11:30 AM</td>
            <td style="color:green;" class="AvailableTimes">
                <input type="checkbox" value="11:00 AM - 12:00 PM;" name="AvailableTimesCheckboxes">11:00 AM - 12:00 PM</td>
            <td style="color:blue;" class="AvailableTimes">
                <input type="checkbox" value="11:30 AM - 12:30 PM;" name="AvailableTimesCheckboxes">11:30 AM - 12:30 PM</td>
        </tr>
        <tr>
            <td style="color:green;" class="AvailableTimes">
                <input type="checkbox" value="12:00 PM - 01:00 PM;" name="AvailableTimesCheckboxes">12:00 PM - 01:00 PM</td>
            <td style="color:blue;" class="AvailableTimes">
                <input type="checkbox" value="12:30 PM - 01:30 PM;" name="AvailableTimesCheckboxes">12:30 PM - 01:30 PM</td>
            <td style="color:green;" class="AvailableTimes">
                <input type="checkbox" value="01:00 PM - 02:00 PM;" name="AvailableTimesCheckboxes">01:00 PM - 02:00 PM</td>
            <td style="color:blue;" class="AvailableTimes">
                <input type="checkbox" value="01:30 PM - 02:30 PM;" name="AvailableTimesCheckboxes">01:30 PM - 02:30 PM</td>
        </tr>
        <tr>
            <td style="color:green;" class="AvailableTimes">
                <input type="checkbox" value="02:00 PM - 03:00 PM;" name="AvailableTimesCheckboxes">02:00 PM - 03:00 PM</td>
            <td style="color:blue;" class="AvailableTimes">
                <input type="checkbox" value="02:30 PM - 03:30 PM;" name="AvailableTimesCheckboxes">02:30 PM - 03:30 PM</td>
            <td style="color:green;" class="AvailableTimes">
                <input type="checkbox" value="03:00 PM - 04:00 PM;" name="AvailableTimesCheckboxes">03:00 PM - 04:00 PM</td>
            <td style="color:blue;" class="AvailableTimes">
                <input type="checkbox" value="03:30 PM - 04:30 PM;" name="AvailableTimesCheckboxes">03:30 PM - 04:30 PM</td>
        </tr>
        <tr>
            <td style="color:green;" class="AvailableTimes">
                <input type="checkbox" value="04:00 PM - 05:00 PM;" name="AvailableTimesCheckboxes">04:00 PM - 05:00 PM</td>
            <td style="color:blue;" class="AvailableTimes">
                <input type="checkbox" value="04:30 PM - 05:30 PM;" name="AvailableTimesCheckboxes">04:30 PM - 05:30 PM</td>
            <td style="color:green;" class="AvailableTimes">
                <input type="checkbox" value="05:00 PM - 06:00 PM;" name="AvailableTimesCheckboxes">05:00 PM - 06:00 PM</td>
            <td style="color:blue;" class="AvailableTimes">&nbsp;</td>
        </tr>
    </tbody>
</table>

```