continue :return true;
break :return false;
直接return也会跳出jQuery。
设置下拉列表选中,并终止迭代
代码如下:
$("#area option").each(function(){
if($(this).text()==addrTmp[2]){
$(this).attr("selected", "selected");//
return false;
}
});
$("#area option").each(function(){
if($(this).text()==addrTmp[2]){
$(this).attr("selected", "selected");//
return false;
}
});