JSFiddle - React, Tailwind, and code Playground
HTML
<input type="radio" name="quiz1" value="1">
<input type="radio" name="quiz2" value="4">
<input type="radio" name="quiz3" value="1">
<button id="result">Get result</button>
JavaScript
$(document).ready(function () {
$("#result").click(function () {
var total = 0;
$('input[type="radio"]:checked').each(function () {
total += this.value << 0;
});
alert(total);
});
});