I have a function that selects text based on an input string. If both matches, I will make it selected. PFb function,
function setDropdownTextContains(dropdownId,selectedValue,hfId){ $('#'+dropdownId+' option').each(function(){ if($(this).text() === selectedValue){ $(this).attr("selected", "selected"); break; } }); $('#'+hfId).val("ModelName doesnt match"); }
I get the following error unlabeled break must be inside loop or switch ... What am I doing wrong?
source share