Javascript examples for jQuery:Tag Traversing
Strange Behaviour With jQuery.find()
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.8.3.js"></script> <script type="text/javascript"> $(window).load(function(){/*from w w w. java 2 s .co m*/ var data = $("<html><title>hello</title><body><form><ul><li>here</li></ul></form></body><ul><li></li></ul></html>"); console.log(data.filter("form").length); console.log(data.find("ul").each.length); }); </script> </head> <body> </body> </html>