How to select a radio button using pure JS and pick up the user-defined value?
Follow my HTML:
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="cadastro" id="professorCadastro" value="professor">
<label class="form-check-label" for="professorCadastro">Professor</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="cadastro" id="alunoCadastro" value="aluno">
<label class="form-check-label" for="alunoCadastro">Aluno</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="cadastro" id="empresaCadastro" value="empresa" disabled>
<label class="form-check-label" for="empresaCadastro">Empresa</label>
</div>
Follow me JS so far
let tipoCadastro = document.getElementsByName('cadastro')