javascript - How do I extract the name from HTML collection? -
here's step through of javascript. i have htmlcollection, want loop through , extract object id of fileuploadcontrol. how do it? here's code, how proceed? function uploadimage(lnk) { var row = lnk.parentnode.parentnode; var rowindex = row.rowindex - 1; var abc = row.cells[2].getelementsbytagname("input"); var arr = [].slice.call(abc); } this it: abc.nameditem('fileuploadcontrol') but beware that: different browsers behave differently when there more 1 elements matching string used index (or nameditem's argument). firefox 8 behaves specified in dom 2 , dom4, returning first matching element. webkit browsers , internet explorer in case return htmlcollection , opera returns nodelist of matching elements. from here . this means if in markup had this: <div id='id'>foo</div> <div id='id'>bar</div> browsers behave differently when executing following code...