Modify ↓
Ticket #6164 (closed bug: invalid)
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: | |
| Blocking: | Blocked by: |
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
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

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.