jquery each中包含switch标签判断错误跳过each循环

来源:互联网 发布:广西网络培训系统 编辑:程序博客网 时间:2024/05/21 14:05
$('li').each(function(){    var isbool=true;    switch($(this).attr('data-type')){        case 'a':{            //如果当前li标签下不存在p标签,则跳出            if($(this).find('p').length==0){                isbool=false;            }                                               break;        }    }    if(isbool==false){        return false;    }});
原创粉丝点击