Adding auto increment value to li element
<p>im a css/designer guy so please excuse my lameness in not knowing any .js</p>

<p>basically i want to know how to add an auto incremental id to a list item with javascript / jquery for something that i am trying to add some css to.</p>

<p>before</p>

<pre><code>&lt;li id=""&gt;&lt;a href=""&gt;Item number 1&lt;/a&gt;&lt;/li&gt;
&lt;li id=""&gt;&lt;a href=""&gt;Item number 2&lt;/a&gt;&lt;/li&gt;
&lt;li id=""&gt;&lt;a href=""&gt;Item number 3&lt;/a&gt;&lt;/li&gt;
</code></pre>

<p>after</p>

<pre><code>&lt;li id="1"&gt;&lt;a href=""&gt;Item number 1&lt;/a&gt;&lt;/li&gt;
&lt;li id="2"&gt;&lt;a href=""&gt;Item number 2&lt;/a&gt;&lt;/li&gt;
&lt;li id="3"&gt;&lt;a href=""&gt;Item number 3&lt;/a&gt;&lt;/li&gt;
</code></pre>

<p>thanks in advance and especially just for reading this</p>

<p>tried all the responses, nothing has worked on a plain html page with nothing but the ul/li items.</p>

<p>thanks to all that tried, i have failed in a big way.....im not a coder</p>
