Here's the step through of the javascript.
I have an HTMLCollection, I want to loop through it and extract the object with the ID of FileUploadControl. How do I do it?
Here's my code, how do I 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 would do it:
But beware that:
From here.
This means that if in your markup you had something like this:
browsers would behave differently when executing the following code:
Firefox would return an HTMLElement, while IE would return another HTMLCollection.
To solve this inconsistencies, you could apply a function to return the same object.
Which could be something like this: