Answers for "how to check which radio button was selected"

5

check if radio button is checked

$('#element').click(function() {
   if($('#radio_button').is(':checked')) { alert("it's checked"); }
});
Posted by: Guest on October-13-2020
3

Get the value of selected radio button

const selectedColor = document.querySelector('input[name="color"]:checked').value;
Posted by: Guest on January-25-2022

Code answers related to "how to check which radio button was selected"

Code answers related to "Javascript"

Browse Popular Code Answers by Language