What I'm trying is quite simple, but for some reason I can't get it working:
I need a way to do different actions based on checkbox state. If it's checked, do something. If not, do something else. For some reason I can only have "checked" state:
$('#checkbox1').on('change', function() {
if ($('#checkbox1:checked')) {
console.log('do something')
} else {
console.log('do something else')
}
});
Codepen: http://codepen.io/anon/pen/EZROGa?editors=1010
what am I missing?