retrieving and assigning corresponding with and height and with of images in Javascript
<p>I am developing an slideshow application. So I have a checkboxes with the corresponding images. So when the user selects the checkboxes and click continue button, the corresponding images should be retrieved by javascript and set its height and width. If height/width is not specified for a particular image, it will be filled with height="" else it will be filled width the height=valuepx. how do I achieve do this.. I could get the array of images but how do I retrieve the same for height and width of corresponding images. Please help... I am a beginner to JS..</p>

<pre><code>function insert_slide()

{ var height;
</code></pre>

<p>var width;</p>

<pre><code>var img=new Array();
var count=0;
var names=document.getElementsByName('image_id');//name of checkboxes


for(i=0;i&lt;names.length;i++)
    {
if(names[i].checked)
    {count=count+1;

    img[i] = "&lt;IMG SRC='" + names[i].value + "'";


    if(height != '') {
        img[i] += " height='" + height[i] + "'";

        }

    else{
    img[i] += " height='"+""+  "'"; 
        }
    if(width != '') {
        img[i] += " width='" + width[i] + "'"; 
    }
else{
img[i] += " width='"+""+  "'"; 
}

}


}



}
</code></pre>
