簡體   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