0

My JQuery function looks like, where a$RadioBtn is the one only radio button list on my form:

IR.Web.cRptCtl.prototype.getSelectedRadioValue = function(a$RadioBtn){
  //Here I want to return a$RadioBtn's selected value
}

How do I determine the selected value?

1

3 Answers 3

1

If a$RadioBtn is a JQuery object of the radio elements, use:

a$RadioBtn.filter(":checked");

This will return a JQuery object, representing the selected radio input field. If you want to perform DOM operations on it, use the .get(0) method to get the DOM element.

Example:

IR.Web.cRptCtl.prototype.getSelectedRadioValue = function(a$RadioBtn){
    var selected = a$RadioBtn.filter(":checked");
    alert(selected.val());
}
Sign up to request clarification or add additional context in comments.

Comments

1
$('input[name="your_radio_name"]).is('checked').val();

this will return value of your selected radio button

Comments

0
$("input[name='name_of_radio']:checked").val();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.