What's the faster, most efficient way to toggle > 10000 checkboxes with Javascript/JQuery? : I have a `div` with more than 10000 checkboxes in it.


```html
<div class="well well-sm" style="min-height: 100px; max-height: 360px; overflow: auto; background-color: #f7f7f7;">

        <label>
            <input type="checkbox" class="checkbox-item" name="some_name" value="28" checked="checked"> Item 1
        </label><br />

<!-- another 10000 of these -->
</div>
```

and this JQuery code that activates when specific buttons are pressed.

```JavaScript
        $('.select-all').click(function () {
            $(this).parent().find(':checkbox:visible').prop('checked', true).change();
        });

        $('.unselect-all').click(function () {
            $(this).parent().find(':checkbox:visible').prop('checked', false).change();
        });

        $('.select-inverse').click(function () {
            $(this).parent().find(':checkbox:visible').click();
        });
```
(Ignore the `:visible` part as the list could be filtered)

When the number of checkboxes is in the thousands the whole thing gets too slow, especially when ~10000 checkboxes need to be toggled.

I was wondering if there's a faster (not necessarily better) way to toggle all of them at the same time (mostly for select/unselect all, as inverse selection can be removed altogether)