HTML:
Javascript:
<form id="test"> <label><input type="radio" name="test" value="A"> A</label> <label><input type="radio" name="test" value="B" checked> B</label> <label><input type="radio" name="test" value="C"> C</label> </form>
Javascript:
document.querySelector('input[name="test"]:checked').value;
Comentarios
Publicar un comentario