Side navigation
#7324 closed bug (duplicate)
Opened October 27, 2010 07:44AM UTC
Closed October 27, 2010 10:04PM UTC
Last modified March 10, 2012 02:56AM UTC
Jquery 1.4.3 bug ( id="id" or name="id" )
Reported by: | cybernetix@gmail.com | 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>
Attachments (0)
Change History (14)
Changed October 27, 2010 08:05AM UTC by comment:1
Changed October 27, 2010 02:35PM UTC by comment:2
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:
[]
Changed October 27, 2010 02:41PM UTC by comment:3
live example: http://jsfiddle.net/eBsjU/
switch from 1.4.2 to 1.4.3 to see the difference
Changed October 27, 2010 03:06PM UTC by comment:4
component: | unfiled → selector |
---|---|
keywords: | → reference id name |
priority: | undecided → low |
resolution: | → duplicate |
status: | new → closed |
Changed October 27, 2010 05:51PM UTC by comment:6
Replying to [comment:5 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>
Changed October 27, 2010 09:23PM UTC by comment:7
priority: | low → blocker |
---|---|
resolution: | duplicate |
status: | closed → reopened |
Changed October 27, 2010 09:23PM UTC by comment:8
milestone: | 1.5 → 1.4.4 |
---|---|
status: | reopened → open |
Changed October 27, 2010 09:25PM UTC by comment:9
@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>
Changed October 27, 2010 09:42PM UTC by comment:10
This is the result of my original hideous patch to Sizzle:
Changed October 27, 2010 10:04PM UTC by comment:11
resolution: | → duplicate |
---|---|
status: | open → closed |
Changed October 27, 2010 10:04PM UTC by comment:12
#7324 is a duplicate of this ticket.
Changed October 27, 2010 10:04PM UTC by comment:13
Duplicate of #7324.
Changed October 27, 2010 10:05PM UTC by comment:14
Whoops. Duplicate of #7212.
Actually it fails at least in FireFox