title: How to get select the li tag before last li tag
body: <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
  
  &lt;body&gt;
  
      &lt;ul&gt;
          &lt;li&gt;1&lt;/li&gt;
          &lt;li&gt;2&lt;/li&gt;
          &lt;li&gt;3&lt;/li&gt;
          &lt;li&gt;4&lt;/li&gt;
      &lt;/ul&gt;
  
      &lt;script&gt;$("ul li:nth-child(3)").append("&lt;span&gt; - Selected!&lt;/span&gt;");&lt;/script&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>I want to select li number 3 and with <code>:nth-child(3)</code> but the problem is that the li tag are random sometime it can be 6 or 9 or 20 .. so how to get the last and maybe then use prev() ?</p>