Ticket #8911 (closed bug: invalid)
the selector not working
| Reported by: | anonymous | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | selector | Version: | 1.5.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
<!DOCTYPE html> <html> <head>
<style>
div { float:left; } span { color:blue; } </style> <script src=" http://code.jquery.com/jquery-1.5.js"></script>
</head> <body>
<div><ul>
<li>John</li> <li>Karl</li> <li>Brandon</li>
</ul></div> <div><ul>
<li>Sam</li>
</ul></div>
<div><ul id="testing">
<li class="test-me">Glen</li> <div>test</div> <li class="test-me">Tane</li> <li class="test-me">Ralph</li>
<li>David</li>
</ul></div>
<script>console.log($("#testing > li.test-me:nth-child(1)").text());</script>
</body> </html>
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.

Thanks for taking the time to contribute to the jQuery project! That selector will not work in some browsers because your html is invalid. Cannot put a div inside a ul.
created test case