Skip to main content

Bug Tracker

Side navigation

#9570 closed bug (fixed)

Opened June 13, 2011 07:31AM UTC

Closed September 19, 2011 07:43PM UTC

Last modified March 08, 2012 11:22PM UTC

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

Reported by: Trial Owned by: timmywil
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>

Attachments (0)
Change History (6)

Changed June 13, 2011 02:08PM UTC by timmywil comment:1

component: unfiledselector
keywords: → sizzle attributes
milestone: 1.next1.7
priority: undecidedlow
status: newopen

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

Changed June 13, 2011 08:54PM UTC by dmethvin comment:2

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/

Changed August 15, 2011 04:07PM UTC by john comment:3

owner: → timmywil
status: openassigned

Changed August 15, 2011 04:09PM UTC by john comment:4

Seems to be a regression of #7212.

Changed September 11, 2011 10:25PM UTC by timmywil comment:5

@john:

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

Changed September 19, 2011 07:43PM UTC by timmywil comment:6

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