adsense

Sunday, December 2, 2018

retrieve RadioButtonList selected value from jQuery

You can use jQery to get  RadioButtonList selected value as shown below.

var selectedVal = $('#<%= RadioButtonList.ClientID %> input:checked').val();

If you inspect the HTML DOM for a radiobutton list, you can observe that it is a set of <input type="radio"> with the same name attribute. So you can use getElementsByName to access the collection of radio buttons their index as shown below.

alert(document.getElementsByName('RadioButtonListName') [0].checked);


cheers,
Samitha


No comments:

Post a Comment