<script type="text/javascript">
function marcarTodos(marcardesmarcar){
$('.marcar').each(function () {
this.checked = marcardesmarcar;
});
}
</script>
<form>
<input type="checkbox" name="cores[]" onclick="marcarTodos(this.checked);">
<span id="acao">Marcar</span> <br>
<input type="checkbox" class="marcar" name="cores[]" value="azul"> azul <br>
<input type="checkbox" class="marcar" name="cores[]" value="verde"> verde <br>
<input type="checkbox" class="marcar" name="cores[]" value="branco"> branco <br>
</form>
Cristian Tales
- 11
- 1