简单来说:
var val = $('input[name="sex"]:checked').val();
整体代码:
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<title>获取单选按钮选中的值</title>
</head>
<body>
<label><input type="radio" name="sex" value="m" checked="checked">男</label>
<label><input type="radio" name="sex" value="f">女</label>
<button>提交</button>
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
<script type="text/javascript">
$(function(){
$('button').click(function(){
var val = $('input[name="sex"]:checked').val();
console.log(val);
});
})
</script>
</body>
</body>
</html>