function getval() { var val $("input[@name='field_type[key]']").each( function() { if (this.checked) { val = this.value; } }); return val; }