Just another jquery newbie, passing and receive params
  


<pre><code>&lt;script type="text/javascript"&gt;
  InitFirstImage(imageId);
&lt;/script&gt;

&lt;img id="1" class="details" width="50" height="50" src="...."&gt;
&lt;img id="2" class="details" width="50" height="50" src="...."&gt;
...
&lt;img id="99" class="details" width="50" height="50" src="...."&gt;
</code></pre>

<p>I need to know first img id(this numbers will be generated dynamicly and it will be stored in collection), so I need to know that Id and pass that value to InitFirstImage() js.</p>

<p>Second question
How can I in js receive that imageId and use that value for some operation, alert for example, on calling script, not onclick event.</p>

<p><strong>Update:</strong>
Now when I have first img Id how can I use it for clone() function.</p>

<pre><code>var clone = $(this).clone(); 
</code></pre>

<p>Can I use this for something like </p>

<pre><code>var firstImageId = $("img.details").first().attr("id");
var clone = $(firstImageId).clone(); //this doesn't work.
</code></pre>

<p>Thank you all.</p>
