I want to get the selected value from a group of radio buttons.
Here\'s my HTML:
HTML CODE:
JQUERY CODE:
var value= $("input:radio[name=rdoName]:checked").val();
$("#btnSubmit").click(function(){
var value=$("input:radio[name=rdoName]:checked").val();
console.log(value);
alert(value);
})
YES
NO
You will get
value="YES" //if checked Radio Button with the value "YES"
value="NO" //if checked Radio Button with the value "NO"