title: Difference between find and filter in jquery
body: <p>I'm working on fetching data from wiki pages. I'm using a combination of <code>php</code> and <code>jquery</code> to do this. First I am using <code>curl</code> in <code>php</code> to fetch page contents and echoing the content. The filename is <code>content.php</code>:</p>
  
  <pre><code>$url = $_GET['url'];
  $url = trim($url," ");
  $url = urldecode($url);
  $url = str_replace(" ","%20",$url);
  
  echo "&lt;a class='urlmax'&gt;".$_GET['title']."&lt;/a&gt;";
  echo crawl($url);
  </code></pre>
  
  <p>Then <code>jQuery</code> is used to find the matched elements. </p>
  
  <pre><code>$.get("content.php",{url:"http://en.wikipedia.org/w/index.php?action=render&amp;title="+str_replace(" ","_",data[x]),title:str_replace(" ","_",data[x])},function(hdata){
                          var imgs = $(hdata).find('a.image img');
                          var ent = $(hdata).filter('a.urlmax');
  
  
                          ent = $(ent[0]).text();
  
  
  });
  </code></pre>
  
  <p>I was able to successfully get images but for the variable ent when I use find instead of filter, it's returning an empty array. Only filter is working. Why is this?</p>
  
  <p>Edit: I know the basic difference between find and filter. Here both the <code>a.image img</code> and <code>a.urlmax</code> are descendats of the <code>hdata</code>. Then why find does not work on <code>a.urlmax</code>. Not <code>a.urlmax</code> alone it's not working on any other class or id</p>