Error type Object doesnt support this kind of property or method on internet explorer
===

Why is my following code not working in Internet Explorer? It work fine in mozilla. I get "object doesnt support this kind of property or method." Please help. Following is the code.

    <script type="text/javascript">
        function calcmrc() {
            var inputs = document.getElementsByClassName('mrc');
            var sum = 0;
            for (var i = 0; i < inputs.length; i++) {
                var input = inputs[i];
                var num = Number(input.value);
                if (isNaN(num)) {
                    alert('Please Enter a valid number: ' + input.value);
                    num = 0;
                }
                sum += num;
            }
            document.getElementById('mrcresult').value = '$' + sum;
        }
    </script>