JSFiddle - React, Tailwind, and code Playground
HTML
<p>Some text</p>
<div>
<div>
<input id="show" name="radioGroup" type="radio" value="1" /><label for="show">Show</label> -
<input id="hide" name="radioGroup" type="radio" value="0" /><label for="hide">Hide</label>
</div>
<div class="myTextBox">
<input type='text'>
</div>
</div>
<p>Some text</p>
CSS
div
{
display: inline-block;
}
input[type='text']
{
margin:2px;
padding:2px;
}
JavaScript
$(function()
{
$("input[type='radio']").change(function(){
ShowHideTextbox();
});
ShowHideTextbox();
});
function ShowHideTextbox()
{
if($("#show").is(":checked"))
$(".myTextBox").css('visibility','visible');
else
$(".myTextBox").css('visibility','hidden');
}