Hi everybody,
I load a page with ajax/jquery, inside it i have some radio one of this may be checked, I'm trying to get value of checked radio, I can not get it on page loading but after it's loaded if a check another radio I can get value. here is example code:
html:
<form id="form1">
<input type="radio" name="a" value="10"> a
<input type="radio" name="a" value="15"> b
<input type="radio" name="a" value="19"> c
</form>
jquery:
$(function(){
var ch=$("input[name='a']:radio:checked");
$.each(ch, function()
{
var chv=$(this).val();
alert(chv);
});
$(":radio[name='a']").click(function(){
var ch=$("input[name='a']:radio:checked");
$.each(ch, function()
{
var chv=$(this).val();
alert(chv);
});
});
});
Thanks in advance. ciao h