I have the following code, what it does is add variables and place the final result in an input, now what I want is that when you click on a checkbox, add 5 to the total result and update the input with the new value , and if I click again on the check, I will subtract those 5 that I added and update again.
var uno = $("#input1").val();
var dos = $("#input2").val();
var tres = $("#input3").val();
var total = uno * 1.5 + dos * 0.5 + tres * 0.5;
document.getElementById("total").value = total;
<input name="total" id="total" class="form-control"/>
<label><input id="agregar" type="checkbox" value="">Option 2</label>