24
rated 0 times
[
28]
[
4]
/ answers: 1 / hits: 24406
/ 11 Years ago, mon, may 6, 2013, 12:00:00
I have a function which selects a text based on the input string. If both matches i make it selected. PFb the 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 below error unlabeled break must be inside loop or switch
... What am i doing wrong??
More From » jquery