html页面
js代码
<script><BR>function checkForm() { <BR>pass = true; <BR>$("td:contains('*')").next().find("input").each(function(){ <BR>if(this.value == '') { <BR>text = $(this).parent().prev().text(); <BR>alert(text+"是必填项"); <BR>this.focus(); <BR>pass = false; <BR>return false;//跳出each <BR>} <BR>}); <BR>return pass; <BR>} <BR></script>