I've been working on changing the background colour of the toggle button to green when it's turned on. I feel like I've followed all the correct steps, but for some reason, the background just stays grey.
Can anyone point out what might be going wrong?
$('.slider-button').toggle(function(){
$(this).addClass('on').parent().next('input[type="checkbox"]').attr('checked', 'checked');
$('.slider-frame').addClass('green');
},function(){
$(this).removeClass('on').parent().next('input[type="checkbox"]').removeAttr('checked');
$('.slider-frame').removeClass('green');
});
Thank you in advance for any help you can provide.