Bug Tracker

Modify

Ticket #8911 (closed bug: invalid)

Opened 2 years ago

Last modified 2 years ago

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

comment:1 Changed 2 years ago by timmywil

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to selector

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

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.