#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 13 years ago by
Component: | unfiled → selector |
---|---|
Resolution: | → invalid |
Status: | new → closed |
comment:2 follow-up: 3 Changed 12 years ago by
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 Changed 12 years ago by
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"
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.