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