Home  >  Article  >  Web Front-end  >  Parse prototype, method to jump out of each loop in JQuery_jquery

Parse prototype, method to jump out of each loop in JQuery_jquery

WBOY
WBOYOriginal
2016-05-16 17:09:36932browse

Copy code The code is as follows:

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


Use
in Jquery

return false;

To jump out of this loop, use continue

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn