How to get the selected radio button’s value?

This works with any explorer.

document.querySelector('input[name="genderS"]:checked').value;

This is a simple way to get the value of any input type.
You also do not need to include jQuery path.

Leave a Comment