Bug Tracker

Ticket #9570 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

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

comment:1 Changed 3 years ago by timmywil

  • Keywords sizzle attributes added
  • Priority changed from undecided to low
  • Status changed from new to open
  • Component changed from unfiled to selector
  • Milestone changed from 1.next to 1.7

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

comment:2 Changed 3 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 3 years ago by john

  • Owner set to timmywil
  • Status changed from open to assigned

comment:4 Changed 3 years ago by john

Seems to be a regression of #7212.

comment:5 Changed 3 years ago by timmywil

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

comment:6 Changed 3 years ago by timmywil

  • Status changed from assigned to closed
  • Resolution set to fixed

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.