Skip to main content

Bug Tracker

Side navigation

#7770 closed bug (duplicate)

Opened December 14, 2010 02:01AM UTC

Closed July 12, 2011 04:18PM UTC

Last modified July 12, 2011 04:18PM UTC

$('[attr]') returns nothing if attr is present but has no value in IE

Reported by: jcattley@gmail.com Owned by:
Priority: high Milestone: 1.next
Component: selector Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

<table data-foo data-bar='bat'>

<tr>

<td id='test'></td>

</tr>

</table>

console.log($('[data-foo]'));

console.log($('#test').parents('[data-foo]'));

console.log($('#test').parents('[data-bar]'));

returns

[<table>...]

[]

[<table>...]

http://jsfiddle.net/MLgXQ/

Attachments (0)
Change History (12)

Changed December 14, 2010 06:22AM UTC by snover comment:1

blockedby: → 5637
component: unfiledselector
priority: undecidedhigh
status: newopen

Changed March 26, 2011 03:30AM UTC by murz comment:2

_comment0: I think this is actually a bug with Sizzle.matchesSelector, see my pull request here: https://github.com/jeresig/sizzle/pull/54 \ \ I also opened a pull request with some regression tests for jQuery: https://github.com/jquery/jquery/pull/2881301111961348424

I think this is actually a bug with Sizzle.matches, see my pull request here: https://github.com/jeresig/sizzle/pull/54

I also opened a pull request with some regression tests for jQuery: https://github.com/jquery/jquery/pull/288

Changed March 26, 2011 04:00AM UTC by timmywil comment:3

This is a duplicate of http://bugs.jquery.com/ticket/7369 and has been fixed in the recent changes to sizzle.

Changed March 28, 2011 09:35PM UTC by murz comment:4

I'm not sure this is a dupe of that bug, and my regression tests still fail in the most recent version of Sizzle.

Also, it looks like the Sizzle repo just moved so my pull request is now here: https://github.com/jquery/sizzle/pull/54

Changed March 28, 2011 09:46PM UTC by timmywil comment:5

No it's not. Sorry, I didn't update my comment.

Changed April 10, 2011 07:51PM UTC by dmethvin comment:6

I closed [pull 288](https://github.com/jquery/jquery/pull/288) from murz to clear out clutter but please include them in the patch if they are useful.

Changed April 17, 2011 08:39PM UTC by john comment:7

milestone: 1.61.next

Changed May 07, 2011 02:22AM UTC by timmywil comment:8

summary: parents('[attr]') returns nothing if attr is present but has no value$('[attr]') returns nothing if attr is present but has no value

Changed May 07, 2011 02:24AM UTC by timmywil comment:9

summary: $('[attr]') returns nothing if attr is present but has no value$('[attr]') returns nothing if attr is present but has no value in IE

A selector with an attribute with no value seems to be the heart of multiple selector bugs.

Changed May 07, 2011 02:24AM UTC by timmywil comment:10

#9159 is a duplicate of this ticket.

Changed July 12, 2011 04:18PM UTC by john comment:11

resolution: → duplicate
status: openclosed

Changed July 12, 2011 04:18PM UTC by john comment:12

Duplicate of #5637.