JavaScript SwitchButton
Bind to the change event by type: jqxSwitchButton.
Author: http://jqwidgets.com
HTML
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<div id="jqxSwitchButton"></div>
JavaScript
$('#jqxSwitchButton').jqxSwitchButton({
height: 35,
width: 80,
theme: 'energyblue'
});
$('#jqxSwitchButton').on('change', function (event) {
alert("You changed the state of the button");
});