Reputation: 8251
I am using the below code to get all the checked radio buttons under a div element. But its not working. I think I am doing something wrong.
#divElement input[type="radio"]:checked
Upvotes: 0
Views: 761
Reputation: 374
$('#divElement input').on('change', function() {
alert($('input[type=radio]:checked', '#divElement ').val());
});
this way you can get the value of selected radio.Also your question is not clear whether it wants list of selected radios or just one?
Upvotes: 1
Reputation: 18600
.val()
property will give you selected radio button value.
$('#divElement input[type="radio"]:checked').val();
Upvotes: 1