开发者

Problem with Javascript loop

The problem im having is that im using a javascript loop to go through all of the elements in a form, but when I alert the different items in the form, by type im not seeing all the elements but the images that are currently within the form. I thought that the images were outside of the form but there not. I checked it when i looked at the source code. Any help would be very much appreciated. Here is the code below:

f开发者_JS百科or (a = 1; a < theForm.elements.length; a++) {
    alert(theForm.elements[a].type + " " + theForm.elements[a].name)
}


Items with the same name, such as radio buttons are actually an array of elements, so a simple loop will skip over these items.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜