I\'m trying to understand where is my error, because it\'s not possible that JS fails in math!
On the HTML form I have a select and 9 text input. Then, on the JS I c
You will have to parse the value before comparison
user parseInt to convert to integer numeric values, or parseFloat to convert to float values
parseInt Help parseFloat Help
Because you're comparing strings, not integers. Use parseInt
to explicitly cast your values as integers.
Here's essentially what you're doing: jsFiddle example
To do the conversion, change your variables to something like:
var new_da1 = parseInt( document.getElementById('new_da1').value, 10);
(assuming they're all integers)