日期:2014-05-16 浏览次数:20590 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <script language="javascript" src="js/jquery-1.js"></script> </head> <body> <div id="gab"> <ul class="f"> <li><span class="mLeft">名称:</span><input type="text" /><span class="mLeft">电话:</span> <input type="text" /></li> <li><span class="mLeft">名称:</span><input type="text" /><span class="mLeft">电话:</span> <input type="text" /></li> <li><span class="mLeft">名称:</span><input type="text" /><span class="mLeft">电话:</span> <input type="text" /></li> <li><span class="mLeft">名称:</span><input type="text" /><span class="mLeft">电话:</span><input type="text" /></li> <li><span class="mLeft">名称:</span><input type="text" /><span class="mLeft">电话:</span><input type="text" /></li> </ul> <p><button id="btn">点击</button></p> </div> </body> <script language="javascript"> $(function(){ /*****/ // checkInput("gab") //alert(checkInput("gab")) /****/ }) //function checkInput(id){ // for(var i=0;i<$("#"+id+" .f > li").length ;i++){ // for(var j=0;j<2;j++){ // var $input=$("#"+id+" .f > li").eq(i).find("input").eq(j); // if($input.val()!="" && $input.siblings("input").val()=="") // alert(0) // } // } //} </script> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <script language="javascript" src="js/jquery-1.js"></script> </head> <body> <div id="gab"> <ul class="f"> <li><span class="mLeft">名称:</span><input type="text" name="name"/><span class="mLeft">电话:</span> <input type="text" name="tel"/></li> <li><span class="mLeft">名称:</span><input type="text" name="name"/><span class="mLeft">电话:</span> <input type="text" name="tel"/></li> <li><span class="mLeft">名称:</span><input type="text" name="name"/><span class="mLeft">电话:</span> <input type="text" name="tel"/></li> <li><s