function getSelectedValue(){ var radios=document.getElementsByName('r1'); var strNew=''; for(i=0;i<radios.length;i++){ if(radios[i].checked){ strNew=radios[i].value; } } alert(strNew); }