Bug Tracker

Opened 15 years ago

Closed 15 years ago

#2590 closed bug (wontfix)

prev() doesn't work in IE

Reported by: telega Owned by:
Priority: major Milestone: 1.2.4
Component: core Version: 1.2.3
Keywords: Cc:
Blocked by: Blocking:

Description

Code $("ul").prev("li") doesn't work in IE. Opera & Firefox work as expected. Code below demostrates the error: "li" tags are not marked by red color in IE.

<script src="jquery-1.2.3.js"></script>

<ul>
  <li id="1">aaa</li>
  <li id="2">bbb</li>
  <ul>
    <li>ccc</li>
    <li>ddd</li>
  </ul>
  <li>eee</li>
  <ul>
    <li>ccc</li>
    <li>ddd</li>
  </ul>
</ul>

<script>
 $(document).ready(function() {
   $("ul").css("color", "blue").prev("li").css("color", "red");
 });
</script>

Change History (2)

comment:1 Changed 15 years ago by telega

Tested in IE7.

comment:2 Changed 15 years ago by davidserduke

Resolution: wontfix
Status: newclosed

This appears to be a problem with IE and nested lists. When I debugged it I found IE thought the main UL only had 3 children (being the 3 LIs and not the nested ULs). I don't see how jQuery could realistically work around this browser bug. If you have some idea feel free to reopen the ticket with your thoughts.

Check the wiki to see that prev() is actually working in IE.

http://docs.jquery.com/Traversing/prev#expr

Note: See TracTickets for help on using tickets.