How to insert different links to multiple <img> tags
<p>I've come up with a piece of code for allowing users to create their own image gallery on a page. 
I want users to be able to put their own links and I want those links to appear in the textarea within each img tag they've created so that they can copy the whole code and paste it e.g. on their page. However, I cannot think of a way to "grab" the content of each input with the link they paste and put it in the  tag in the textarea section. It always shows the content of the first input. 
Any help, please? :)
Here's the code I've come up with so far:</p>

<pre><code> Image height: &lt;input type="text" id="imgHeight" /&gt;&lt;br /&gt;&lt;br /&gt;
 Image width:  &lt;input type="text" id="imgWidth" /&gt;&lt;br /&gt;&lt;br /&gt;
 Number of images: &lt;input type="text" id="imgNo" /&gt;&lt;br /&gt;&lt;br /&gt;
 &lt;p id="additionalImgs"&gt;&lt;/p&gt;
    &lt;input type="button" value="Show code" id="result" onclick="abba()" /&gt;&lt;br /&gt;&lt;br /&gt;  
    &lt;textarea rows="20" cols="60" id="output"&gt;&lt;/textarea&gt;
    &lt;script&gt;
    $(document).ready(function(){
        $("#result").click(function(){
            var imgHeight = $("#imgHeight").val();
            var imgWidth = $("#imgWidth").val();
            var imgNo = $("#imgNo").val();
            var text = '';
            var y = 1;
            for(i=0; i&lt;imgNo; i++){
            var aaa = $("#additionalImgs input").val();
            text += "&lt;img src='"+aaa +"' width='"+imgHeight+"' height='"+imgWidth+"' name='"+ y++ +"' /&gt;";
}
$('#output').text(text);

            });
        });
$(document).ready(function(){
            $("#imgNo").change(function(){
                var imgNo = $("#imgNo").val();
                x = 1;
                var y = 1;
                var text = "Image number: ";
                for(i=0; i&lt;imgNo; i++){
                $("#additionalImgs").append(text + y++ + ' link' + "&lt;input type='text' name='"+ x++  +"'&gt;&lt;br /&gt;")};
                });
            });

    &lt;/script&gt;
</code></pre>
