jquery 判断哪个单选哪个选中
//name是单选项名称,:checked就是判断是否选择上了。
$(":input[name='sex']:checked").val()
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>单选项</title>
<script type="text/javascript" src="http://www.sz886.com/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(e) {
$(":input[name='sex']").click(function(){
alert($(":input[name='sex']:checked").val());
});
});
</script>
</head>
<body>
男<input type="radio" value="男" name="sex" /> 女<input type="radio" value="女" name="sex" />
</body>
</html>