ACP*_*ACP 8 javascript jquery break
我有一个函数,它根据输入字符串选择文本.如果两个匹配我选择它.PFb的功能,
function setDropdownTextContains(dropdownId,selectedValue,hfId){
$('#'+dropdownId+' option').each(function(){
if($(this).text() === selectedValue){
$(this).attr("selected", "selected");
break;
}
});
$('#'+hfId).val("ModelName doesnt match");
}
Run Code Online (Sandbox Code Playgroud)
我得到以下错误unlabeled break must be inside loop or switch......我做错了什么?