Fixed tally

This commit is contained in:
Donavon McDowell 2023-06-26 15:21:49 -06:00
parent b455951b1a
commit 0b967b3853

View File

@ -50,7 +50,10 @@
<INPUT type='range' min='50' max='200' value='100' name='s1' id='s1'> <INPUT type='range' min='50' max='200' value='100' name='s1' id='s1'>
<SPAN id="p1" class="percent-color"></SPAN> <SPAN id="p1" class="percent-color"></SPAN>
</TD> </TD>
<TD><INPUT type='text' name='t1' id='t1' readonly></TD> <TD>
<INPUT type='text' name='t1' id='t1' readonly>
<SPAN id="p1" class="percent-color"></SPAN>
</TD>
</TR> </TR>
<TR> <TR>
<TD>Civil</TD> <TD>Civil</TD>
@ -337,7 +340,7 @@ function updateTotal() {
total += value; total += value;
}); });
// Output the updated total to the console // Output the updated total to the console
console.log(total); //console.log(total);
// Display the updated total in the input box with ID "totalBox1" // Display the updated total in the input box with ID "totalBox1"
document.querySelector('#totalBox1').value = '$' + total.toFixed(2); document.querySelector('#totalBox1').value = '$' + total.toFixed(2);
} }
@ -373,7 +376,8 @@ function updateTotal() {
total2 += value2; total2 += value2;
}); });
// Output the updated total to the console // Output the updated total to the console
console.log(total2); console.log(total2.toLocaleString('en-US'))
// Display the updated total in the input box with ID "totalBox2" // Display the updated total in the input box with ID "totalBox2"
document.querySelector('#totalBox2').value = '$' + total2.toFixed(2); document.querySelector('#totalBox2').value = '$' + total2.toFixed(2);
} }
@ -390,6 +394,10 @@ inputs2.forEach(input => {
sliders2.forEach(slider => { sliders2.forEach(slider => {
slider.addEventListener("input", updateTotal); slider.addEventListener("input", updateTotal);
}); });
inputs.forEach(input => {
input.addEventListener("input", updateTotal);
});
</SCRIPT> </SCRIPT>
</BODY> </BODY>
</DOCTYPE> </DOCTYPE>