2.2.2 • Published 10 months ago

@w0s/button-checkboxes v2.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Button to check / uncheck checkboxes group

npm version test status

Demo

Examples

<script type="importmap">
  {
    "imports": {
      "@w0s/button-checkboxes": "..."
    }
  }
</script>
<script type="module">
  import ButtonCheckboxes from '@w0s/button-checkboxes';

  for (const targetElement of document.querySelectorAll('.js-button-checkboxes')) {
    new ButtonCheckboxes(targetElement);
  }
</script>

<button type="button" class="js-button-checkboxes"
  data-course="check"
  data-control="checkbox-group"
>Check all</button>
<p id="checkbox-group">
  <label><input type="checkbox" /> 1</label>
  <label><input type="checkbox" /> 2</label>
  <label><input type="checkbox" /> 3</label>
</p>

<button type="button" class="js-button-checkboxes"
  data-course="check"
  data-controls-class="checkbox"
>Check all</button>
<p>
  <label><input type="checkbox" class="checkbox" /> 1</label>
  <label><input type="checkbox" class="checkbox" /> 2</label>
  <label><input type="checkbox" class="checkbox" /> 3</label>
</p>

<button type="button" class="js-button-checkboxes"
  data-course="check"
  data-controls-name="checkbox[]"
>Check all</button>
<p>
  <label><input type="checkbox" name="checkbox[]" /> 1</label>
  <label><input type="checkbox" name="checkbox[]" /> 2</label>
  <label><input type="checkbox" name="checkbox[]" /> 3</label>
</p>

* uuid is no longer required since version 2.1

Attributes

2.2.1

11 months ago

2.2.0

11 months ago

2.2.2

10 months ago

2.1.0

1 year ago

2.0.0

2 years ago