Check all input fields have been filled out with jQuery

前端 未结 4 1062
轻奢々
轻奢々 2020-12-08 14:12

I have 3 divs, each with a dfew input fields and next button on. I want to write a snippet of jQuery that when the next button is clicked it checks to ensure all input fiel

4条回答
  •  渐次进展
    2020-12-08 14:49

    $('.next').click(function() {
        var inputs = $(this).parent().find('input[value=""]');
        if (!inputs.length) {
            // you have empty fields if this section is reached
        }
    });
    

提交回复
热议问题