How would I achieve this:
if($(this).parent().find('input:checked') == true)
{$(this).find('.switch').attr('state','on');}
else{$(this).find('.switch').attr('state','off');}
I know this is wrong but you get the idea I think :). If there is an input that is checked add state on if not state off.