// get a node list of all the ingredients on the page var ingredients = document.querySelectorAll('.wppizza_ingr_option.wppizza_option'); // and then loop through each one, setting the meal size ingredients.forEach(function(ingredient){ ingredient.querySelector('input[type="checkbox"]').checked=true; })