...
<input type=
"radio"
name=
"age"
value=
"10"
/>
<input type=
"radio"
name=
"age"
value=
"20"
checked=
"checked"
/>
<input type=
"radio"
name=
"age"
value=
"30"
/>
...
//javascript code
<script type=
"text/javascript"
>
<!--
// displays the selected radio button in an alert box
alert($(
'input[name=age]:checked'
).val())
-->
var age = $("input[name='age']:checked").val();
alert(age);
</script>
No comments:
Post a Comment