JSFiddle - React, Tailwind, and code Playground

HTML

<input id='input1' type='radio' name="myInput">
<span id='a1' style='display: none;'>Joku teksti 1</span>
<br>
<input id='input2' type='radio'  name="myInput">
<span id='a2' style='display: none;'>Joku teksti 2</span>
<br>
<input id='input3' type='radio'  name="myInput">
<span id='a3' style='display: none;'>Joku teksti 3</span>

JavaScript

function showA1() {
	document.getElementById('a1').style.display = 'inline-block';
	document.getElementById('a2').style.display = 'none';
	document.getElementById('a3').style.display = 'none';
}

function showA2() {
	document.getElementById('a1').style.display = 'none';
	document.getElementById('a2').style.display = 'inline-block';
	document.getElementById('a3').style.display = 'none';
}

function showA3() {
	document.getElementById('a1').style.display = 'none';
	document.getElementById('a2').style.display = 'none';
	document.getElementById('a3').style.display = 'inline-block';
}

//onclick-attribuutin laittaminen suoraan html:ään ei jostain syystä
//toimi, joten laitetaan ne näin ohjelmallisesti
document.getElementById("input1").onclick = showA1;
document.getElementById("input2").onclick = showA2;
document.getElementById("input3").onclick = showA3;