I would like to get checked value of some radiubutton.
That is not a problem when you using expression:
$("input[name='radioname']:checked").val();
but I have a situation when I need to use DOM object from variable as below:
var obj = $("[name=myradio1]");
and now I’m operating with variable obj.
Please explain how to get a checked value from obj variable
this is html code:
<input id="answer_21" type="radio" value="21" name="answer[1]">
<input id="answer_22" type="radio" value="22" name="answer[1]">
alright… this works, I don’t know can it be written better, probably can…