Ticket #3403 (closed bug: invalid)
Traversing lists upward causes failed selection in IE6
| Reported by: | bravesirrobin | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.3 |
| Component: | selector | Version: | 1.2.6 |
| Keywords: | prev, list, nested lists, parent | Cc: | bravesirrobin, flesler |
| Blocking: | Blocked by: |
Description
Here's a sample of a case I encountered in development.
<head>
<script src=" http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){
var firstText = $("#testId").text(); var secondText = $("#testId").parent().prev().text(); alert(firstText+", "+secondText);
});
</script>
</head> <body> <ul>
<li>Bar</li> <ul>
<li>Things</li> <li id="testId">Stuff</li>
</ul> <li>Baz</li> <ul>
<li>Text</li> <li>Misc</li>
</ul>
</ul> </body> </html>
=========================================== In latest Firefox, Safari, Opera, the alert is "Stuff, Bar", but in IE6 this is "Stuff, ". It's like the DOM structure for IE6 is somehow different for nested ULs. Didn't have IE7 handy, but that would be something to check as well.
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.

The top <ul> has some children <ul>'s. That's illegal html.