How can I create a comma-separated list of IDs in JavaScript?
<p>So I have a <code>&lt;ul&gt;</code> that contains <code>&lt;li&gt;</code> elements, and I'd like to grab the IDs of these out and pass them on in a querystring to another page.</p>

<p>Like so:</p>

<pre><code>&lt;ul id="myList"&gt;
   &lt;li id="first"&gt;First&lt;/li&gt;
   &lt;li id="second"&gt;Second&lt;/li&gt;
   &lt;li id="third"&gt;Third&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>into </p>

<pre><code>first,second,third
</code></pre>

<p>Is there a neat way to do this? I've jQuery, so my brute-force probably-not-very-good-approach is to iterate using <code>each()</code> and build it that way. A bit scruffy, I think.</p>
