get value from radio group using jquery get value from radio group using jquery jquery jquery

get value from radio group using jquery


Try this

var manageradiorel = $("input:radio[name ='managerelradio']:checked").val();alert(manageradiorel);

Plese check this DEMO ..it will work fine

Note: One of your radio button must be selected. Otherwise it will return undefined

You can use checked attribute to make a radio button selected as default


It works for me

$('input[name="managerelradio"]').on('change', function(e) {    var manageradiorel = e.target.value;    alert(manageradiorel);});

Exaple here


A small jQuery extension to make this a little easier:

jQuery.fn.extend({    groupVal: function() {        return $(this).filter(':checked').val();    }});// Usage:$("input[name='managerelradio']").groupVal();// Or even:$("[name='managerelradio']").groupVal();