Bug Tracker

Modify

Ticket #3473 (closed bug: invalid)

Opened 6 years ago

Last modified 5 years ago

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:
Blocking: Blocked by:

Description

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

<ul id="test_div">

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

</ul>

<script type="text/javascript">

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

alert('Success');

});

</script>

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

comment:1 Changed 6 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 5 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.