Skip to main content

Bug Tracker

Side navigation

#6164 closed bug (invalid)

Opened February 24, 2010 04:33PM UTC

Closed November 14, 2010 03:19AM UTC

issue with index method (DOM Element Method)

Reported by: chrismo111 Owned by:
Priority: undecided Milestone: 1.4.2
Component: misc Version: 1.4.1
Keywords: index, DOM Element Methods Cc:
Blocked by: Blocking:
Description

Problem with .index method (Miscellaneous > DOM Element Methods), http://api.jquery.com/index/

Here's a scenario that worked in 1.3.2 but does not in version 1.4.2:

var fruits=["apple","orange","pear"];

var i = $(fruits).index("pear");

alert(i);

In version 1.3.2 the value of i is 2.

In version 1.4.2 the value is -1

a non jquery alternative is indexOf BUT IE6 doesn't support it

Attachments (0)
Change History (1)

Changed November 14, 2010 03:19AM UTC by dmethvin comment:1

priority: → undecided
resolution: → invalid
status: newclosed

I don't think we support wrapping an array of strings in a jQuery object and then applying jQuery methods on that. It may have worked in the past by chance.