You just need to push the regular change event for the switches themselves. Extension in the example on jQueryUI website:
Html:
<div id="radio"> <input type="radio" id="radio1" name="radio" value="1" /><label for="radio1">Choice 1</label> <input type="radio" id="radio2" name="radio" value="2" checked="checked" /><label for="radio2">Choice 2</label> <input type="radio" id="radio3" name="radio" value="3" /><label for="radio3">Choice 3</label> </div>
JavaScript:
$("#radio").buttonset(); $("input[name='radio']").on("change", function () { alert(this.value); });
The buttonset widget is just the style of the radio buttons. All regular events will fire as expected.
Example: http://jsfiddle.net/andrewwhitaker/LcJGd/
source share