Adding different classes to each list item
<p>I've created a list and am trying to add a different class name to each one. Currently, I'm using this method:</p>

<p>HTML:</p>

<pre><code>&lt;ul class="sd-list"&gt;
   &lt;li&gt;&lt;a href="#"&gt;List Item 1&lt;/a&gt;&lt;/li&gt;
   &lt;li&gt;&lt;a href="#"&gt;List Item 2&lt;/a&gt;&lt;/li&gt;
   &lt;li&gt;&lt;a href="#"&gt;List Item 3&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>jQuery:</p>

<pre><code>$('.sd-list:nth-child(1)').addClass('green');
$('.sd-list:nth-child(2)').addClass('red');
$('.sd-list:nth-child(3)').addClass('purple');
</code></pre>

<p>This works fine, but I'm wondering if there is a better method than the one I'm currently using. Any help would be greatly appreciated.</p>
