JSFiddle - React, Tailwind, and code Playground
HTML
<div id="boxes">
<div class="test_f">
<input type="radio" name="test4" data-exval="1" id="test_4_0" /> <label for="test_4_0">Lorem ipsum.</label>
</div>
<div class="test_f">
<input type="radio" name="test4" data-exval="0" id="test_4_1" /> <label for="test_4_1">Lorem ipsum.</label>
</div>
<div class="test_f">
<input type="radio" name="test4" data-exval="0" id="test_4_2" /> <label for="test_4_2">Lorem ipsum.</label>
</div>
<div>Итого: <span id="result"></span></div>
JavaScript
$(document).ready(function(){
$(".test_f input[type='radio']").click(function(){
var total=0;
$(".test_f input[type='radio']:checked").each(function(){
total += parseInt($(this).data("exval"),10);
});
$("#result").text(total);
});
});