Bug Tracker

Ticket #4391: Has Selector Test.html

File Has Selector Test.html, 1.0 KB (added by beaugunderson, 14 years ago)

Bug repreoduction

Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3  <head>
4    <title>jQuery :has() selector test</title>
5   
6    <script type="text/javascript" lang="javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.js"></script>
7   
8    <script type="text/javascript" lang="javascript">
9     $(document).ready(function () {
10         // Test A - passes
11         $("#test_li").after('<li><a href="#">Test A failed.</a></li>');
12         $("#test_li").next(":has(a)").text("Test A worked.");
13         
14         // Test B - fails
15         $("#test_li_3").after('<li><a href="#">Test B failed.</a></li>');
16         $("#test_li_2").next(":has(a)").text("Test B worked.");
17     });
18    </script>
19  </head>
20  <body>
21   <ul id="test_ul">
22    <li>a</li>
23    <li id="test_li">b</li>
24    <li>c</li>
25    <li>d</li>
26    <li id="test_li_2">e</li>
27    <li>f</li>
28    <li id="test_li_3">g</li>
29    <li>h</li>
30    <li>i</li>
31   </ul>
32  </body>
33</html>