check

Get/Set the checked state of the widget.

Parameters

check Boolean

Whether to turn the widget on or off.

Returns

Boolean The checked state of the widget.

Example

<div id="foo" data-role="view">
  <input id="switch" type="checkbox" data-role="switch" />
  <a data-role="button" data-click="onClick">Change status</a>
</div>

<script>
var app = new kendo.mobile.Application();
function onClick() {
  // get a reference to the switch widget
  var switchInstance = $("#switch").data("kendoMobileSwitch");

  // get the checked state of the switch.
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(switchInstance.check());
  // set the checked state of the switch.
  switchInstance.check(true);
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(switchInstance.check());
}
</script>
In this article