Return state or set state if you pass parameter.
Fires
changeParameters
Name | Type | Description |
---|---|---|
value | {string} | State of the checkbox. Accept only checked, unchecked or indeterminate as values. |
Examples
sample
<button onclick="$chkb.state('checked')" class="gj-button-md">Set to checked</button>
<button onclick="$chkb.state('unchecked')" class="gj-button-md">Set to unchecked</button>
<button onclick="$chkb.state('indeterminate')" class="gj-button-md">Set to indeterminate</button>
<button onclick="alert($chkb.state())" class="gj-button-md">Get state</button>
<hr/>
<input type="checkbox" id="checkbox"/>
<script>
var $chkb = $('#checkbox').checkbox();
</script>