Here's a couple of searches I'd made - 'javascript checkbox value checked then add class to parent' , 'jquery onload' and 'jquery check an object with no action'
The code that worked for me is as such
$("input[type=checkbox], input[type=radio]").each(function(){ console.log('loading checkbox object'); // is(':checked') if($(this).is(':checked')){ $(this).parent().addClass("chked"); $(this).parent().parent().addClass("chked"); } });