Home > Article > Web Front-end > Parse prototype, method to jump out of each loop in JQuery_jquery
function chk(){
var flag=true;
var msg='';
var tips={'username':'Name','tel':'Telephone','company':'Company Name','loupan_name':' Property name','sdate':'Group purchase time','content_1':'Group purchase content'};
$$('.required').each(function(el){
el).blank()){
msg = 'Please enter' tips[$(el).readAttribute('id')] '!nn';
}
}
Throw $break to break out of each loop
in Jquery
return false;
To jump out of this loop, use continue