JSFiddle - React, Tailwind, and code Playground
HTML
<input type="radio" id="chlVal" name="selVal" value="Val 1"/>Value 1<br/>
<input type="radio" id="chkOther" name="selVal" value="Other"/>Other<br/>
<input type="text" id="txtOther">
<button id="btn" onclick="Javascript: checkOther()" value='Check'>Check Form</button>
JavaScript
function checkOther()
{
if (document.getElementById('txtOther').value!='')
{
alert('Value in the box');
document.getElementById('chkOther').checked=1;
}
}