JSFiddle - React, Tailwind, and code Playground

HTML

<input type="checkbox" class='marcar' />
<input type="checkbox" checked disabled class='marcar' />

<button class='btn btn-large' type='button' title='Todos' id='todos' onclick='marcardesmarcar();'><i class='icon-large  icon-ok'>Click</i></button>

JavaScript

function marcardesmarcar() {
    $('.marcar').each(function() {
        if (this.checked) {
            if ($(this).prop('disabled')) return;
            else this.checked = false;;
        } else {
            this.checked = true;
        }
    });
}