Using flip toggle switch i my not getting alert message when toogle is "off" or "on" in jquery mobile plz help me out
in html5
<select name="toggleswitch1" id="toggleswitch1" data-theme="" data-role="slider">
<option value="off">Off</option>
<option value="on">On</option>
</select>
in script
$(document).bind("pageinit", function () {
$("#toggleswitch1").unbind('change').bind('change', function() {
if ($("#toggleswitch1").val('off').slider('refresh')) {
alert("off");
}
else {
alert("on");
}
});
});