I have a checkbox in a form and I\'d like it to work according to following scenario:
totalCost
try
totalCost.value = checkbox.checked ? 10 : calculate();
function change(checkbox) { totalCost.value = checkbox.checked ? 10 : calculate(); } function calculate() { return other.value*2; }
input { display: block}
Checkbox: Total cost: Other: