jquery each

 

/**
 * index - 选择器的 index 位置
 * element - 当前的元素(也可使用 "this" 选择器)
 */
$(selector).each(function(index,element){
    
});

//结束循环
function check() {
    $("li").each(function(index,demo){
        if(demo.val() > 0){

        }else {
            return false;//跳出循环体
            //return true; //跳出本次循环,继续下次循环
        }
    })
}

猜你喜欢

转载自my.oschina.net/u/2608562/blog/848100