To get the selected radio button’s value with JavaScript, we get the value
property.
For instance, we write
const value = document.querySelector('input[name="genderS"]:checked').value;
to select the checked radio button with name attribute genders
and that it’s checked by calling querySelector
with 'input[name="genders"]:checked'
Then we get its value with the value
property.