Stop checkbox from being check in alpineJS?
You can bind to disabled
and check count >= 12
.
<div x-data="{ count: 0 }"> <input type="checkbox" :disabled="count >= 12" @click="toggle = !toggle, count = count + 1" ></div>
You can bind to disabled
and check count >= 12
.
<div x-data="{ count: 0 }"> <input type="checkbox" :disabled="count >= 12" @click="toggle = !toggle, count = count + 1" ></div>