title: jQuery index and selectors :lt and :gt
body: <p>How do the selectors lt and gt work?? Is the same the order they are put? (if they are both in the same selector)</p>
  
  <p>I need two answers for this question.</p>
  
  <p>1) The result of the following line shouldn't ALWAYS be 0??? I'm asking those td wich index be greater than 3 AND lower than 2. There is index that could be: ix > 3 &amp; ix &lt; 2 at the same time!!</p>
  
  <pre><code>$("tr").find("td:gt(3):lt(2)").length
  </code></pre>
  
  <p>2) It turns out that when I change the order of the selectors gt and lt it starts working good. The result of the following line is 0.</p>
  
  <pre><code>$("tr").find("td:lt(2):gt(3)").length
  </code></pre>
  
  <p>Shoudn't the order of the selectors be indiferent to the result?</p>
  
  <p>It is like if selector lt wont work if it is after a gt or something like that!</p>
  
  <p>Additional info:</p>
  
  <ul>
  <li>You can watch this here: <a href="http://jsfiddle.net/YQtRh/" rel="noreferrer">http://jsfiddle.net/YQtRh/</a></li>
  <li>For those who wonder what is the result of the first js line is 1.</li>
  <li>In the example that td returned by the first line is the last one (.text() == 4)</li>
  </ul>
  
  <p>Thanks!</p>
  
  <p>Diego</p>