In this script below it marks and unchecks all checkbox but would like that when a checkbox is "checked" and "disabled" does not change anything. The problem is that I do not know how to do this, would anyone have an idea?
<input type="checkbox" class='marcar' />
<input type="checkbox" checked disabled class='marcar' />
JS:
<button class='btn btn-large' type='button' title='Todos' id='todos' onclick='marcardesmarcar();'>
<i class='icon-large icon-ok'>Click</i>
</button>
<script>
function marcardesmarcar() {
$('.marcar').each(function () {
if (this.checked)
$(this).attr("checked", false);
else
$(this).prop("checked", true);
});
}
</script>