JSFiddle - React, Tailwind, and code Playground

by nderscore

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 (this.value == "dog") {
    breed.style.display = "inline";

  }
  else {
    breed.style.display = "none";
  }
}

    var typeOfPet = document.getElementsByName('petType');
   
for(var i = typeOfPet.length; i--;)
    typeOfPet[i].addEventListener('change', asdf, false);