Getting ASP.NET Radiobutton list Text using javascript not JQuery

I came accross a problem while I was trying to Get ASP.NET Radiobutton list Text using JQuery.

I used the JQuery method


but it was not returning selected value though same works for Dropdown list then I started searching over the internet but didn’t find any solution.

After searching for an hour I started looking for classic javascript to get the text of selected item in the Radio button list,
but all of the examples were giving me value of the selected item in the radio button list.

Onec I was struggling to get the text of selected item in dropdown list then found a solution which you can see in my post here
by combining the logic of this disablingenabling-aspnet-checkboxlist-items-using-javascritp
post with the code below I was able to find a solution to my problem.
Following code will give you the text of selected Item in an radio button list same also is true check box  list

function getRadioButtonText()
var elementId = ‘<%=RadioButtonList1.ClientID%>’;
var elementRef = document.getElementById(elementId);
var checkBoxArray = elementRef.getElementsByTagName(‘input’);

var checkedValue = ”;
var isChecked = false;

for (var i = 0; i < checkBoxArray.length; i++) {
if (document.getElementById(elementId + “_” + i.toString()).checked == true) {
var checkBoxRef = checkBoxArray[i];
var labelArray = checkBoxRef.parentNode.getElementsByTagName(‘label’);
checkedValue = labelArray[0].innerHTML;
Chekced = false;



Please post a JQuery solution if you have .

Tags: , , , ,

15 Responses to “Getting ASP.NET Radiobutton list Text using javascript not JQuery”

  1. admin says:

    Java script code was not working so I’ve changed it, this is 100% working code. Sorry! for any inconvenience caused.

  2. Sutha says:

    jQuery solution: (for this problem)


  3. Sutha says:

    jQuery Solution:


  4. Sutha says:

    instead of #…please use #

  5. Mahesh says:

    Excellent.Thanks a Lot

  6. Yosel says:

    like Sutha said:

  7. Yosel says:

    like Sutha said:

  8. Anti- Coder says:

    It saved my life

    Thanks a lot

  9. Lee says:

    the code is work…
    thanks for sharing this valuable code!

  10. Jyothi says:

    Hey, This solution works like a charm.
    Thanks a ton.

  11. Trupti says:

    Hey thanks a lot for such a valuable code. I had left hopes…. Thanks a lot.

  12. John says:

    Life Saver. Thank you.

  13. Usman Khalid says:

    Thank you very much man. Great post. 🙂

  14. BindraBindu says:

    Hello Everyone,
    This is very nice article !!!!!!! really great.
    you can use javascript in same manner with simple html radiobutton, for example please check out the following links…..

    Thanks !!!!!!