// set this to the ID of the meal size var mealSize = ""; // 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){ let dropdown = ingredient.querySelector('select.ingredients'); dropdown.value = mealSize; })