今天在做后台管理系统的时候遇见一个问题:
<script type="text/javascript">
$(
function(){
var check_val = $("input[name='myname']['checked']").val();
alert(check_val) ; // 输出0, 切永远是0
})
</script>
var check_val = $("input[name='myname']['checked']").val();
alert(check_val) ; // 输出0, 切永远是0
})
</script>
2
<
input
type
="radio"
name
="myname"
value
="0"
checked
="checked"
>
3
<
input
type
="radio"
name
="myname"
value
="1"
>