JSFiddle - React, Tailwind, and code Playground
by gkislin13
HTML
<div>
<input type="radio" name="pay" checked> <b class="darkred">Value1</b>
<input type="radio" name="pay"> <b>Value2</b>
<input type="radio" name="pay"> <b>Value3</b>
</div>
CSS
.darkred {
color: darkred;
}
JavaScript
$('input[type="radio"]').on('change', function () {
var current = $(this);
current.closest('div').find('input').each(function () {
$(this).next().removeClass('darkred')
});
current.next().addClass('darkred');
});