JQuery / Javascript Add "id" to a <div> where class="x"
<p>I have a line of code which is...</p>

<pre><code>&lt;div class="x"&gt;
   xyz
&lt;/div&gt;
</code></pre>

<p>I want to write a script to find the div where class == "x", and change it to be...</p>

<pre><code>&lt;div class="x" id="y"&gt;
   xyz
&lt;/div&gt;
</code></pre>

<p><strong>any help is appreciated</strong></p>
