I have a JS code whitch I wrote to add the values of variables together, but it just writes the values next to each other, it does not add them together. How to I add these values together?
JS:
function display(){ let dollarvalue = `$ ${motorverseny}+${motorprofi}+${motoralap}+${turboverseny}+${turboprofi}+${turboalap}+${ecuverseny}+${ecuprofi}+${ecualap}+${valtoverseny}+${valtoprofi}+${valtoalap}+${felfuggesztesverseny}+${felfuggesztesprofi}+${felfuggesztesalap}`; let ppvalue = `${motorvenom}+${turbovenom}+${ecuvenom}+${valtovenom}+${felfuggesztesvenom}`; document.getElementById("pptext").innerHTML = `${ppvalue}`; document.getElementById("dollartext").innerHTML = `${dollarvalue}`; } HTML:
<h3 class="dollar">Dollar:</h3> <h5 id="dollartext" style="color: #7cc576;"></h5> <h3 class="pp">PP:</h3> <h5 id="pptext" style="color: blue;"></h5>
+signs.