JQuery Mobile 1.4.0 for handling Flip Switch events

How to add an event handler for a flip switch in JqueryMobile 1.4.0 I have a flip switch of type

<input type="checkbox" data-role="flipswitch" name="flip-checkbox" id="flip-checkbox">

The event handler mentioned in the documentation,

$( "#flip-checkbox" ).on( "flipswitchcreate", function( event, ui ) { alert("Flip    Switched"); } );

I also tried using $ .click () and $ .change (). But nothing happens when the switch is changed. How do we deal with this?

+3
source share
1 answer

use it like that

$( document ).on( "change", "#flip-checkbox",  function( event, ui ) {
 alert("Flip    Switched"); 
} );
0
source

All Articles