JSFiddle - React, Tailwind, and code Playground
HTML
<label for="petType">Type of Pet: </label>Cat<input class="radio" name="petType" type="radio" id="petType" value="cat">Dog<input class="radio" name="petType" id="petType" type="radio" value="dog">Other<input class="radio" name="petType" id="petType" type="radio" value="other">
<label for="state">Breed:</label>
<select id="breed">
<option>Shiba Inus</option>
<option>Pembroke Welsh Corgi</option>
<option>Boxer</option>
<option>English Bulldog</option>
</select>
CSS
#breed {
display:none;
}
JavaScript
function asdf(x) {
var breed = document.getElementById('breed');
if (dog == "dog") {
breed.style.display = "inline";
}
else {
breed.style.display = "none";
}
}
var typeOfPet = getElementsByName('petType');
typeOfPet.AddEventListener('change', asdf, false);