发现find在火狐下找不到多级的后代元素,只能找到后一代元素。在ie下能找到多级后代元素。大家知道为什么吗?请指点一下。
<!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" />
<script type="text/javascript" language="javascript" src="/js/jquery/jquery1.5.js"></script>
<title>inuptEvaluation Test</title>
</head>
<body>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tbody id="rootmenu">
<form method="get" id="FirstForm" name="searchForm">
<tr>
<td>用户Id:<input class="textinput" type="text" id="siteId" name="siteId" reg='{"isnull":"no","length":"30","func":"num"}'/></td>
<td>相册Id:<input class="textinput" type="text" id="albumId" name="albumId" reg='{"isnull":"no","length":"30","func":"num"}'/></td>
<td>照片Id:<input class="textinput" type="text" id="photoId" name="photoId" reg='{"length":"30","func":"num"}'/></td>
<td></td>
</tr>
</form>
</tbody>
</table>
<br/>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td>
<form method="get" id="SecondForm" name="searchForm">
用户Id:<input class="textinput" type="text" id="siteId" name="siteId" reg='{"isnull":"no","length":"30","func":"num"}'/>
相册Id:<input class="textinput" type="text" id="albumId" name="albumId" reg='{"isnull":"no","length":"30","func":"num"}'/>照片Id:<input class="textinput" type="text" id="photoId" name="photoId" reg='{"length":"30","func":"num"}'/>
</form>
</td>
</tr>
</table>
</div>
<script>
$(function(){
alert("FirstForm** "+$("#FirstForm").find(":input[reg]").size()); --ie下3 ,火狐下为0
alert("SecondForm** "+$("#SecondForm").find(":input[reg]").size());--ie下3 ,火狐下为0
});
</script>
</body>
</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" />
<script type="text/javascript" language="javascript" src="/js/jquery/jquery1.5.js"></script>
<title>inuptEvaluation Test</title>
</head>
<body>
<form method="get" id="FirstForm" name="searchForm">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tbody id="rootmenu">
<tr>
<td>用户Id:<input class="textinput" type="text" id="siteId" name="siteId" reg='{"isnull":"no","length":"30","func":"num"}'/></td>
<td>相册Id:<input class="textinput" type="text" id="albumId" name="albumId" reg='{"isnull":"no","length":"30","func":"num"}'/></td>
<td>照片Id:<input class="textinput" type="text" id="photoId" name="photoId" reg='{"length":"30","func":"num"}'/></td>
<td></td>
</tr>
</tbody>
</table>
</form>
<br/>
<form method="get" id="SecondForm" name="searchForm">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td>
用户Id:<input class="textinput" type="text" id="siteId" name="siteId" reg='{"isnull":"no","length":"30","func":"num"}'/>
相册Id:<input class="textinput" type="text" id="albumId" name="albumId" reg='{"isnull":"no","length":"30","func":"num"}'/>照片Id:<input class="textinput" type="text" id="photoId" name="photoId" reg='{"length":"30","func":"num"}'/>
</td>
</tr>
</table>
</form>
</div>
<script>
$(function(){
alert("FirstForm** "+$("#FirstForm").find(":input[reg]").size());
alert("SecondForm** "+$("#SecondForm").find(":input[reg]").size());
});
</script>
</body>
</html>
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。