Is there a reason why my attempt to loop through all the elements retrieved by getElementsByTagName("input")
using forEach is not functioning in Firefox, Chrome, or Internet Explorer?
<html>
<head>
</head>
<body>
<input type="text" value="" />
<input type="text" value="" />
<script>
function DisplayResults(value, index, array) {
alert(index);
}
var inputElements = document.getElementsByTagName("input");
alert(inputElements.length);
inputElements.forEach(DisplayResults);
</script>
</body>
</html>