I'm trying to make a simple sum in a routine:
var sum1 = $('input[name=hdValor01]').val(); // 40
var sum2 = $('input[name=hdValor02]').val(); //
var sum3 = $('input[name=hdValor03]').val(); // 30
console.log(
parseInt(sum1) + parseInt(sum2) + parseInt(sum3)
);
On the console, NaN is returning. But they are numbers ... without the parseInts, it is concatenating the variables.
Any ideas? I've already tried using valueOf (), without success.