Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#6112 closed bug (invalid)

:eq() Selector not working in Chrome, Safari and Opera

Reported by: cssensei Owned by:
Priority: undecided Milestone: 1.4.2
Component: selector Version: 1.4.1
Keywords: :eq() Selector Cc:
Blocked by: Blocking:

Description

I'm curently working on a new project. I had to add some classes to may navigation system and I've used the following snippet:

jQuery(".left_nav ul.menu li:eq(7)").addClass("sub");

and all gone fine in firefox and internet explorer, but in chrome, safari and opera nothing happened. They don't recongize this as a function. I managed to figure out that a working snippet for all browsers is a little different. Here's the working jQuery line:

jQuery(".left_nav ul.menu li").eq(7).addClass("sub");

Is this a jQuery bug?

Change History (3)

comment:1 Changed 10 years ago by dmethvin

Component: unfiledselector
Resolution: invalid
Status: newclosed

Kind of hard to say without a complete test case that includes the markup. However, this type of question is best handled in the forum, rather than the bug tracker.

comment:2 Changed 9 years ago by anonymous

I have the same problem and I think it's a bug in Opera.

<div id="someId"> <span>1</span> <span>2</span> <span>3</span> </div>

This works: $('span:eq(1)').text();

This doesn't work: $('#someId span:eq(1)').text();

comment:3 in reply to:  2 Changed 9 years ago by jitter

Priority: undecided

Replying to anonymous:

I have the same problem and I think it's a bug in Opera.

<div id="someId"><span>1</span><span>2</span><span>3</span></div>

This works: $('span:eq(1)').text();

This doesn't work: $('#someId span:eq(1)').text();

test case Can't reproduce this. Both return "2"

Note: See TracTickets for help on using tickets.