krish mandava krish mandava - 4 years ago 124
jQuery Question

Get the text of the selected radio button in JQuery

In Jquery How do I get the text (not values) for the selected radio button as shown below

<label> <input type="radio" name="Surv_Q1" value="20">5 - Excellent</label>
<label> <input type="radio" name="Surv_Q1" value="20">4 - Good</label>

I tried with the below code , but didn't work


Answer Source


<label> <input type="radio" name="Surv_Q1" value="20" data-name="5 - Excellent" checked="true">5 - Excellent</label>
<label> <input type="radio" name="Surv_Q1" value="20" data-name="4 - Good">4 - Good</label>



OR you don't want to change in HTML then this one::

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download