Skip to main content

Bug Tracker

Side navigation

#12953 closed bug (duplicate)

Opened November 24, 2012 10:49PM UTC

Closed November 25, 2012 03:51AM UTC

Last modified November 25, 2012 02:40PM UTC

index() does not search using [attr=value] selectors

Reported by: xorax Owned by: xorax
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.3
Keywords: Cc:
Blocked by: Blocking:

it seems jquery incorrectly handles selectors in index() method. To demonstrate the issue I have created a code sample

<!DOCTYPE html>
  <script type="text/javascript" src=""></script>
  <script type="text/javascript">
      // this works

      //this doesnt
  <p data-custom-id="342">
  <p data-custom-id="36">
  <p data-custom-id="57647">
  <p data-custom-id="433">

Attachments (0)
Change History (5)

Changed November 24, 2012 11:15PM UTC by rwaldron comment:1

owner: → xorax
status: newpending

Attribute selectors require quotes around the value

Changed November 24, 2012 11:18PM UTC by xorax comment:2

status: pendingnew

with quotes it does not work as well

Changed November 25, 2012 03:51AM UTC by dmethvin comment:3

resolution: → duplicate
status: newclosed

Duplicate of #12792.

Changed November 25, 2012 09:41AM UTC by xorax comment:4

I do not agree this bug is duplicate of #12792!

In my case index() does not work at all. It returns -1 when filter() with the same parameters returns non-empty set.

Shouldn't index() and filter() work in a similar way?

Changed November 25, 2012 02:40PM UTC by dmethvin comment:5

No. Ask for help on the forum.