Bug Tracker

Opened 14 years ago

Closed 14 years ago

#3473 closed bug (invalid)

Sibling Selectors Fail in IE for <li> Tag

Reported by: wardrop Owned by:
Priority: major Milestone: 1.3
Component: selector Version: 1.2.6
Keywords: Cc:
Blocked by: Blocking:


Example (works in firefox & chrome, fails in IE6/IE7):

<ul id="test_div">

<li>block1</li> <ul>block2</ul>


<script type="text/javascript">

$("#test_div li + ul").click(function () {




Seems to apply to every tag following a <li> tag (ie. "li + div" also fails), except for "li + li". Bug also seems to apply to the "li ~ ul" syntax.

Change History (2)

comment:1 Changed 14 years ago by wardrop

This ticket may be closed. The reason this is happening is because placing anything inside a <ul> element, outside of a <li> element is invalid. Most browsers don't mind this and leave the code as is, but IE6/IE7 shifts the out of place element into the previous <li> element.

In other words, this...

<ul> <li>item</li> <li>item</li> <div>content here</div> <li>item</li> </ul>

becomes... <ul> <li>item</li> <li>item <div>content here</div> </li> <li>item</li> </ul>

comment:2 Changed 14 years ago by dmethvin

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.