#7324 closed bug (duplicate)
Jquery 1.4.3 bug ( id="id" or name="id" )
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | blocker | Milestone: | 1.4.4 |
Component: | selector | Version: | 1.4.3 |
Keywords: | reference id name | Cc: | |
Blocked by: | Blocking: |
Description
If id="id" or name="id" then .find() fails.
<script type="text/javascript" language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js" charset="utf-8"></script> <script type="text/javascript"> jQuery(function(){
console.log($("#frm").find("#id").length); console.log($("#frm").find("[name=id]").length); console.log($("#frm").find(".cls").length);
}); </script> <form id="frm" name="frm">
<input id="id" name="id" value="0" type="hidden" /> <input class="cls" id="f1" name="f1" value="" type="text" />
</form>
Change History (14)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
I confirm this.
html:
<form action="?" method="get"><input type="hidden" name="id" value="5" /></form>
js:
$('form').find('input')
jQuery 1.4.2 returns:
[input]
jQuery 1.4.3 returns:
[]
comment:3 Changed 13 years ago by
live example: http://jsfiddle.net/eBsjU/
switch from 1.4.2 to 1.4.3 to see the difference
comment:4 Changed 13 years ago by
Component: | unfiled → selector |
---|---|
Keywords: | reference id name added |
Priority: | undecided → low |
Resolution: | → duplicate |
Status: | new → closed |
comment:6 Changed 13 years ago by
Replying to addyosmani:
Duplicate of #7212.
Issue still persists ( jQuery 1.4.4rc1 & Firefox v3.6.11 )
Test this in Firefox v3.6.11, not on JSFIDDLE:
<script type="text/javascript" language="javascript" src="http://code.jquery.com/jquery-1.4.4rc1.min.js" charset="utf-8"></script> <script type="text/javascript"> $(function(){ console.log($("form").find("#id").length); console.log($("form").find("[name=id]").length); console.log($("form").find(".cls").length); console.log($("#frm").find("#id").length); console.log($("#frm").find("[name=id]").length); console.log($("#frm").find(".cls").length); console.log($("[name=frm]").find("#id").length); console.log($("[name=frm]").find("[name=id]").length); console.log($("[name=frm]").find(".cls").length); }); </script> <form id="frm" name="frm"> <input id="id" name="id" value="0" type="hidden" /> <input class="cls" id="f1" name="f1" value="" type="text" /> </form>
comment:7 Changed 13 years ago by
Priority: | low → blocker |
---|---|
Resolution: | duplicate |
Status: | closed → reopened |
comment:8 Changed 13 years ago by
Milestone: | 1.5 → 1.4.4 |
---|---|
Status: | reopened → open |
comment:9 Changed 13 years ago by
@addyosmani, this is definitely the same as 7212, but I'm reopening because it's clearly still an issue and this new ticket has significantly more data.
ALSO!!! I used this code:
<script src="http://code.jquery.com/jquery-git.js"></script> <script > $(function(){ console.log($("form").find("#id").length); console.log($("form").find("[name=id]").length); console.log($("form").find(".cls").length); console.log($("#frm").find("#id").length); console.log($("#frm").find("[name=id]").length); console.log($("#frm").find(".cls").length); console.log($("[name=frm]").find("#id").length); console.log($("[name=frm]").find("[name=id]").length); console.log($("[name=frm]").find(".cls").length); }); </script> <form id="frm" name="frm"> <input id="id" name="id" value="0" type="hidden" /> <input class="cls" id="f1" name="f1" value="" type="text" /> </form>
comment:11 Changed 13 years ago by
Resolution: | → duplicate |
---|---|
Status: | open → closed |
Actually it fails at least in FireFox