1
How to select a radio button using pure JS and pick the value set by the user?
Follow my HTML code:
<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')
Valina Javascript would not be Vanilla Javascript ?
– Isac
Where does the "user" define something?
– Sam