title: how to get a tr id which is less than a number
body: <p>I have following html table layout:</p>
  
  <pre><code>&lt;table border="1" id="staff"&gt;
    &lt;tr&gt;
      &lt;th&gt;Company&lt;/th&gt;
      &lt;th&gt;Contact&lt;/th&gt;
      &lt;th&gt;Country&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr id="1"&gt;
      &lt;td&gt;Alfreds Futterkiste&lt;/td&gt;
      &lt;td&gt;Maria Anders&lt;/td&gt;
      &lt;td&gt;Germany&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr id="2"&gt;
      &lt;td&gt;Berglunds snabbköp&lt;/td&gt;
      &lt;td&gt;Christina Berglund&lt;/td&gt;
      &lt;td&gt;Sweden&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr id="5"&gt;
      &lt;td&gt;Centro comercial Moctezuma&lt;/td&gt;
      &lt;td&gt;Francisco Chang&lt;/td&gt;
      &lt;td&gt;Mexico&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr id="8"&gt;
      &lt;td&gt;Ernst Handel&lt;/td&gt;
      &lt;td&gt;Roland Mendel&lt;/td&gt;
      &lt;td&gt;Austria&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr id="9"&gt;
      &lt;td&gt;Island Trading&lt;/td&gt;
      &lt;td&gt;Helen Bennett&lt;/td&gt;
      &lt;td&gt;UK&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr id="12"&gt;
      &lt;td&gt;Königlich Essen&lt;/td&gt;
      &lt;td&gt;Philip Cramer&lt;/td&gt;
      &lt;td&gt;Germany&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr id="13"&gt;
      &lt;td&gt;Laughing Bacchus Winecellars&lt;/td&gt;
      &lt;td&gt;Yoshi Tannamuri&lt;/td&gt;
      &lt;td&gt;Canada&lt;/td&gt;
    &lt;/tr&gt;
   &lt;tr id="15"&gt;
      &lt;td&gt;Magazzini Alimentari Riuniti&lt;/td&gt;
      &lt;td&gt;Giovanni Rovelli&lt;/td&gt;
      &lt;td&gt;Italy&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr id="16"&gt;
      &lt;td&gt;North/South&lt;/td&gt;
      &lt;td&gt;Simon Crowther&lt;/td&gt;
      &lt;td&gt;UK&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>for some reason, l want to find the tr id which will be lower than a number by jquery. Suppose, the number is 11, so the id less than 11 is 9,  again if the number is 7, then the id is 5. I am trying as follows:</p>
  
  <pre><code>var rank = 5;
  var target_id = $('#staff tr').filter(function() {
      return this.id &lt; rank;
  }).last();
  
  alert(target_id);
  </code></pre>
  
  <p>but it is not working. It is showing "object Object". how to get the tr id in this case.</p>