Display the text label for selected radio button in Jquery

Posted by Thinker on Stack Overflow See other posts from Stack Overflow or by Thinker
Published on 2010-03-23T11:56:02Z Indexed on 2010/03/23 12:23 UTC
Read the original article Hit count: 219

Filed under:

Hai,

I have a group of radio buttons, i could able to pick the selected value using jQuery but not the text label for selected values.

for ex:

<input type="radio" value="1" name="priority">High</input>
<input type="radio" value="2" name="priority">Medium</input>
<input type="radio" value="3" name="priority">Low</input>

JQUERY CODE TO PICK THE SELECTED VALUE

jQuery('input:radio[name=priority]').change(function()
{
 var priority_type=jQuery(this).attr("value");
        alert(priority_type);
}

OUTPUT would be any one of the following (1,2,3)

Now my requirement is, i would like to display the label of the selected values for eg (high or low or medium) depends on the selection of the radio button.

Hope this helps. let me know if you have any question. Kindly help me in this task

© Stack Overflow or respective owner

Related posts about jQuery