counting number of empty inputs with a certain class

前端 未结 3 1362
-上瘾入骨i
-上瘾入骨i 2020-12-16 04:34

I have tried a couple of solutions from previous questions, but no luck. Hoping someone can help me out.

I have a section of a form where fields are dynamically crea

3条回答
  •  既然无缘
    2020-12-16 05:13

    mm just posting my version using .not

    $('.user_field').blur(function() {
       var count = $('.user_field').not(function() {
            return this.value;
        }).length;
    
        alert(count);
    });
    

    DEMO

提交回复
热议问题