title: add class to last 2 links from a generate ul list
body: <p>I have a function that generates a unordered list of links and I want to use javascript to select the last 2 links so that I can align them to the right.</p>
  
  <p>so in the following example I would need to select the <strong>li parent</strong> of link4 and link5, then add a class so i can style it</p>
  
  <pre><code>&lt;ul&gt;
  &lt;li&gt;link1&lt;/li&gt;
  &lt;li&gt;link2&lt;/li&gt;
  &lt;li&gt;link3&lt;/li&gt;
  &lt;li&gt;link4&lt;/li&gt;
  &lt;li&gt;link5&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>In the end it should be something like this:</p>
  
  <pre><code>&lt;ul&gt;
  &lt;li&gt;link1&lt;/li&gt;
  &lt;li&gt;link2&lt;/li&gt;
  &lt;li&gt;link3&lt;/li&gt;
  &lt;li class="align_right"&gt;link4&lt;/li&gt;
  &lt;li class="align_right"&gt;link5&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>