I have a form:
Es5 forEach:
Array.prototype.forEach.call(form.elements, function (inpt) {
if(inpt.name === name) {
inpt.parentNode.removeChild(inpt);
}
});
Otherwise the lovely for:
var input;
for(var i = 0; i < form.elements.length; i++) {
input = form.elements[i];
// ok my nice work with input, also you have the index with i (in foreach too you can get the index as second parameter (foreach is a wrapper around for, that offer a function to be called at each iteration.
}