Fires when the state of the widget changes

Event Data

e.checked Object

The checked state of the widget.

Handle mobile Switch change event

<div id="foo" data-role="view">
  <input id="switch" type="checkbox" data-role="switch" data-change="onChange" />

var app = new;

function onChange(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(e.checked);//true of false
In this article
Not finding the help you need? Improve this article