JQuery 得到radio
<div>
<input id="Radio1" type="radio" name="rad" value="1" checked />1
<input id="Radio2" type="radio" name="rad" value="2" />2
<input id="Radio3" type="radio" name="rad" value="3" />3
<input id="Radio4" type="radio" name="rad" value="4" />4
<input id="Radio5" type="radio" name="rad" value="5" />5
<input id="Button1" type="button" value="button" onclick="return Button1_onclick()" />
<input id="Button2" type="button" value="button" onclick="return Button2_onclick()" />
</div>
<script language="javascript" type="text/javascript">
// <![CDATA[
function Button1_onclick() {
$("input").each(function () {
if (this.type == 'radio') {
alert($(this).val());
}
});
}
function Button2_onclick() {
//alert($("input[@type=radio]:checked").val());
//alert($("input[name='rad']:checked").val());
alert($("input[@type=radio]").val());
}
// ]]>
</script>