how to add two variables, I'm doing it like this and they are concatenating
id('total-quotas').addEventListener('keyup', function () {
id('vl_total').value = (id('total-quotas').value + id('valor6').value);
});
how to add two variables, I'm doing it like this and they are concatenating
id('total-quotas').addEventListener('keyup', function () {
id('vl_total').value = (id('total-quotas').value + id('valor6').value);
});
They are concatenating because they are strings.
If you expect those two values to be numeric, then cast them via parseInt.
parseInt(id('total-quotas').value, 10) + parseInt(id('valor6').value, 10)
Are these strings? If they are strings they will contact, if they are integers passed as strings you might need to parse as an integer