How can I implement java script to an array. Suppose I have a text box with name=txtphone[]. Though I can implement it for single text box using document.getElementByName("txtphone"), but it’s not working for txtphone array.
How can I implement java script to an array. Suppose I have a text
Share
The actual syntax is “
document.getElementsByName("txtphone")” and not “document.getElementByName("txtphone")“.Also, in your case, you need to use “
document.getElementsByName("txtphone[]")“, and it will return an array of elements who are having the same name.Hope it helps.