Bug Tracker


Ticket #7280 (closed bug: duplicate)

Opened 4 years ago

Last modified 2 years ago

use form as selector context will tamper form's id if it contains a input named "id" in chrome

Reported by: quaff Owned by:
Priority: high Milestone: 1.5
Component: unfiled Version: 1.4.3
Keywords: form element name id Cc:
Blocking: Blocked by:


<html> <head> <title>test</title> <script src=" http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js" type="text/javascript"></script> <script> $(function(){

$('input',$('form')); alert($('form').attr('id'));


</script> </head> <body>

<form id="test"><input type="text" name="id"/></form>

</body> </html>

alert "[object HTMLInputElement]" not "test" in chrome

this works fine in firefox and IE 1.4.2 works fine in chrome change name to "id2" works fine

Change History

comment:2 Changed 4 years ago by addyosmani

  • Keywords form element name id added
  • Priority changed from undecided to high
  • Status changed from new to closed
  • Resolution set to duplicate

This is a duplicate of #7275.

comment:3 Changed 4 years ago by addyosmani

Duplicate of #7275.

comment:4 Changed 3 years ago by anonymous

Thanks a lot for this post. I was able to resolve my issue on similar lines usinfg your suggestion.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


Add a comment

Modify Ticket

as closed

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.