JSFiddle - React, Tailwind, and code Playground

HTML

<input type="radio" name="BuySell" value="B" checked="checked"> Buy

<br style="clear:both;" />

<input type="radio" name="BuySell" value="S"> Sell


<div id="output">Buy</div>

JavaScript

[].forEach.call(document.getElementsByName('BuySell'), el => {
  el.addEventListener('click', event => {
		document.getElementById('output').textContent = event.target.value === 'B' ? 'Buy' : 'Sell';
  })
});