Slider: How to use variables in a formule


i’m new on javascripting so can someone help me?
I’m using te folowing code for 2 sliders


Uw leeftijd is: 21jaar

Uw maandelijkse storting is: 50 euro

How do I get the variable newValue and newValue2 in a formule.
Something like this:

total= newValue + newVulue2; document.write(total);
The formule needs to change everytheme that 1 variabel changed and not using a button (=calculate).

Can someone help me with this?


total= sld.getValue()*1 + sld2.getValue()*1;