title: Counting list elements from ajax response
body: <p><strong>jQuery</strong></p>
  
  <pre><code>$.ajax({
      url : "/assets/inc/list.php",
      success : function (data) {
          console.log($(data).filter('li').size());
      }
  });
  </code></pre>
  
  <p>Using the above I have tried the total number of list items in that php as the response puts back a list of </p>
  
  <pre><code>&lt;li&gt;
  </code></pre>
  
  <p>with content inside them</p>
  
  <p>but I get a console.log  error of </p>
  
  <blockquote>
    <p>Error: Syntax error, unrecognized expression:</p>
  </blockquote>
  
  <p>which has my list echoed afterwards.</p>
  
  <p><strong>example of data</strong></p>
  
  <pre><code>&lt;li&gt;
      &lt;strong&gt;Company Name&lt;/strong&gt;
      123 Fake Street&lt;br /&gt;
      Fakesville&lt;br /&gt;
      &lt;a href="#"&gt;Link&lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
      &lt;strong&gt;Company Name&lt;/strong&gt;
      123 Fake Street&lt;br /&gt;
      Fakesville&lt;br /&gt;
      &lt;a href="#"&gt;Link&lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
      &lt;strong&gt;Company Name&lt;/strong&gt;
      123 Fake Street&lt;br /&gt;
      Fakesville&lt;br /&gt;
      &lt;a href="#"&gt;Link&lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
      &lt;strong&gt;Company Name&lt;/strong&gt;
      123 Fake Street&lt;br /&gt;
      Fakesville&lt;br /&gt;
      &lt;a href="#"&gt;Link&lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
      &lt;strong&gt;Company Name&lt;/strong&gt;
      123 Fake Street&lt;br /&gt;
      Fakesville&lt;br /&gt;
      &lt;a href="#"&gt;Link&lt;/a&gt;
  &lt;/li&gt;
  </code></pre>