繁体   English   中英

如何验证表中的行以填充 jquery 中的所有列?

[英]how to validate row in a table to fill all the column in jquery?

如何验证表中的行以填充 jquery 中的所有列?

<script type="text/javascript">
$(document).ready(function(){
    $("button").click(function(){
        $("tr").each(function(){
            $(this).children("td").each(function(){
                if($(this).val()==""){
                    alert("plz fill complete row");
                }
            });
        });
    });
});
</script>

你有没有注意到你有错字:你写了两次函数而不是 function...?

<script type="text/javascript">
 $(document).ready(function(){
   $("button").click(function(){
    $("tr").each(function(){
     $(this).children("td").each(function(){
        if($(this).val()==""){
        alert("plz fill complete row");
                         }
        });
        });
});
});

</script>

这个应该工作

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM