Fixed tally
This commit is contained in:
parent
b455951b1a
commit
0b967b3853
@ -50,7 +50,10 @@
|
||||
<INPUT type='range' min='50' max='200' value='100' name='s1' id='s1'>
|
||||
<SPAN id="p1" class="percent-color"></SPAN>
|
||||
</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>
|
||||
<TD>Civil</TD>
|
||||
@ -337,7 +340,7 @@ function updateTotal() {
|
||||
total += value;
|
||||
});
|
||||
// Output the updated total to the console
|
||||
console.log(total);
|
||||
//console.log(total);
|
||||
// Display the updated total in the input box with ID "totalBox1"
|
||||
document.querySelector('#totalBox1').value = '$' + total.toFixed(2);
|
||||
}
|
||||
@ -373,7 +376,8 @@ function updateTotal() {
|
||||
total2 += value2;
|
||||
});
|
||||
// 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"
|
||||
document.querySelector('#totalBox2').value = '$' + total2.toFixed(2);
|
||||
}
|
||||
@ -390,6 +394,10 @@ inputs2.forEach(input => {
|
||||
sliders2.forEach(slider => {
|
||||
slider.addEventListener("input", updateTotal);
|
||||
});
|
||||
|
||||
inputs.forEach(input => {
|
||||
input.addEventListener("input", updateTotal);
|
||||
});
|
||||
</SCRIPT>
|
||||
</BODY>
|
||||
</DOCTYPE>
|
Loading…
Reference in New Issue
Block a user