title: How to get size of a list(returning from Controller) in onChange() JQuery
body: <p>I am returning a list from Controller class.</p>
  
  <pre><code>httpReq.setAttribute("playersList", playersList);
  </code></pre>
  
  <p>I want size of this list in onchange() method.</p>
  
  <pre><code>$('#teams').on('change', function(){
   // code to get the size/count
    if(count &lt; 11){
    .........
    }else{
    .........
    }
  }
  </code></pre>
  
  <p>here I am displaying that list:</p>
  
  <pre><code>&lt;tr id = "players" style="display:none;"&gt;
      &lt;td class="tabHead"&gt;PLAYER NAMES&lt;/td&gt;
      &lt;td&gt;
          &lt;div class=""  id="playerNames" name="playerNames" &gt;            
              &lt;c:forEach items="${playersList}" var="playersListItem"&gt;                                
                  ${playersListItem.name}&lt;br&gt; 
              &lt;/c:forEach&gt;
          &lt;/div&gt;
      &lt;/td&gt;       
  &lt;/tr&gt;
  </code></pre>
  
  <p>I tried -</p>
  
  <pre><code>var count = playersList.length;
  var count = $("#players").length;
  </code></pre>
  
  <p>but that didn't work.</p>