I have few hidden fields which should become visible on click of a link.

Below is the html code
<table>
<thead>
<tr><th></th></tr>
</thead>
<tbody>
<tr>
<td align="center">
<span id="hoverspan">
<a href="#" onclick="DisplaySelectedPart('1')"><label id="internalNumber">121334</label></a></span>
<input type="hidden" name="shipmentDetails.lineItems.part.mfgNumber" value="345245" id="part.mfgNumber1"/>
<input type="hidden" name="shipmentDetails.lineItems.part.description" value="red and blue chicken sweaters out of graphite" id="part.description1"/>
/// This is loop so on click DisplaySelectedPart function , i want to display these loop values into different elements on screen.
<input type="hidden" name="shipmentDetails.lineItems[1].attachments[1].fileName" value="1.txt" id="fileName1"/>
<input type="hidden" name="shipmentDetails.lineItems[1].attachments[2].fileName" value="2.txt" id="fileName1"/>
</td>
</tr>
</tbody>
</table>

I have written javascript function
function DisplaySelectedPart(ind) {
var internalpn="part.internalNumber"+ind;
if(document.getElementById(internalpn).value !== null )
{
document.getElementById("internalPartNumber").value=document.getElementById(internalpn).value;
}
var pmfgnum="part.mfgNumber"+ind;
if(document.getElementById(pmfgnum).value !==null)
{
document.getElementById("mfgDistPartNumber").value=document.getElementById(pmfgnum).value;
}
var pdesc="part.description"+ind;
if(document.getElementById(pdesc).value !==null)
{
document.getElementById("description").value=document.getElementById(pdesc).value;
}
var fname=document.getElementById("fileName"+ind);
if(fname !=null && typeof fname !== "undefined" && fname.value !== null)
{

var jsVar = '<sroperty value="#urlTag"/>';
document.getElementById("attachment.fileName").value=fname.value;
document.getElementById("pdfName").value=fname.value;
jsVar=fname.value;
}
}

My problem , i want to populate hidden attachment list which can contain any number of fileName into html fields via javascript.
Please guide me.