How To Know Which Radio Button Is Selected Using Jquery




Here we consider how to Know Which Radio Button Is Selected Using Jquery. Suppose you have a group of radio buttons having same Group Name.


Know Which Radio Button Is Selected Using Jquery, How To Know Which Radio Button Is Selected Using Jquery, Know Which Radio Button Is Selected, Which Radio Button Is Selected Using Jquery, Which Radio Button Is Selected, Jquery, Radio Button, Group Name


If you use conditional statement for each radio button, you can get the value. But it may be somewhat complex to use if else statement for each Rdio Button. Instaed there is an easy way to find which radio button is selected in Jquery. We have to make use of Jquery Change event.


$(function () {
         $('#form1 input').on('change', function () {
                  alert($('input[name=techno]:checked', '#form1').val());
         });
})




When you select any of the radio button, the corresponding value will be shown. We would listen for the change event in any of the radio buttons inside this form. If Change event is triggered, then checked item's value can be taken as shown above.