Hello greetings to all my friends. I have a little question.
I want to select progressively the checkboxes that appear in the image when I press a button. For example, pressing the button selects the first checkbox, if you press it again, the first checkbox is unchecked and the second checkbox is selected. If I press the button again the second one is demarcated and the third one is marked and so on until the end. And when the last checkbox arrives, if I click on the button, the last checkbox will be unchecked and the first one will be marked and the process can be repeated.
I appreciate your help. Thank you very much
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
<tr>
<td>Checkbox 1: <input type="checkbox" name="checkbox[]" /></td>
<td>Checkbox 2: <input type="checkbox" name="checkbox[]" /></td>
<td>Checkbox 3: <input type="checkbox" name="checkbox[]" /></td>
<td>Checkbox 4: <input type="checkbox" name="checkbox[]" /></td>
<td>Checkbox 5: <input type="checkbox" name="checkbox[]" /></td>
<td>Checkbox 6: <input type="checkbox" name="checkbox[]" /></td>
<td>Checkbox 7: <input type="checkbox" name="checkbox[]" /></td>
<td>Checkbox 8: <input type="checkbox" name="checkbox[]" /></td>
</tr>
</table>
<input type="button" value="Marcar" class="button">
<script type="text/javascript">
$(".button").click(function() {
$("input[type=checkbox]").prop("checked",true);
})
</script>