I'm curious about how the cool turn on/off switch button actually works. Take a look at for reference.
I'm interested in implementing a prevention check to confirm whether the user truly wants to switch the button. Here's a snippet of the code I've been working with:
$(document).on('change', '.onoffswitch',function(event){...
http://jsfiddle.net/aGZ7Y/2/
Even though the change event is triggered, it doesn't seem to stop the switch behavior as intended.
Interestingly, this functionality is achieved purely through CSS. It's puzzling why a change event would be triggered after interacting with the button, especially since the checkbox is set to display:none.
Thanks in advance for any insights you can provide!