I'm wondering how do I add two values that are set when I frame the checkbox.
I made this code, It does not work as I expected, I wanted it to take the number that is already in the input and add another value when marking the checkbox, and remove the same amount that was added when unchecking
$('#booster15p').change(function(){
if($(this).attr('checked')){
$('#tdmxp').val(10+1.5);
}else{
$('#tdmxp').val(11.5-1.5);
}
});
$('#booster50p').change(function(){
if($(this).attr('checked')){
$('#tdmxp').val(10+5);
}else{
$('#tdmxp').val(15-5);
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script><inputtype="checkbox" name="1.5" id="booster15p"/>Aumenta em 1.5
<input type="checkbox" name="5" id="booster50p"/>Aumenta em 5
<input class="tdmxp" id="tdmxp" value="10" >