Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#9570 closed bug (fixed)

Selector $('form[name=".."]') returns zero elements in IE8 under some conditions

Reported by: Trial Owned by: Timmy Willison
Priority: low Milestone: 1.7
Component: selector Version: 1.6.1
Keywords: sizzle attributes Cc:
Blocked by: Blocking:

Description

Selector $('form[name=".."]') returns zero elements in IE8 if form has <input name="name">

<form name="form1"> <input type="text" name="name"> </form>

<script>

alert($('form[name="form1"]').length); 0 in IE8, 1 in Mozilla

</script>

Change History (6)

comment:1 Changed 12 years ago by Timmy Willison

Component: unfiledselector
Keywords: sizzle attributes added
Milestone: 1.next1.7
Priority: undecidedlow
Status: newopen

When sizzle uses jQuery's attr logic, this won't be a problem.

comment:2 Changed 12 years ago by dmethvin

Also it is risky to use attribute names that match other attribute/property names, like id, target, action, name, per DomLint:

http://kangax.github.com/domlint/

comment:3 Changed 12 years ago by john

Owner: set to Timmy Willison
Status: openassigned

comment:4 Changed 12 years ago by john

Seems to be a regression of #7212.

comment:5 Changed 12 years ago by Timmy Willison

@john: It is? I think this is a problem for all versions of jQuery. Correct me if I'm wrong.

comment:6 Changed 12 years ago by Timmy Willison

Resolution: fixed
Status: assignedclosed

Override Sizzle attribute retrieval with jQuery.attr. Fixes #5637, #7128, #9261, #9570, #10178.

Bug fixed on the side: $(window).is('a') was throwing an exception. Fixes #10178.

Changeset: 92405d4f5ffe9ec1f26f280303783014948438c5

Note: See TracTickets for help on using tickets.