<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="../js/jquery-3.2.1.min.js"></script>
<script>
$(function () {
$("input[type=\'radio\']").on("click",function () {
if($("input[id=\'a\']:checked").val()=="1"){
console.log("11111");
}else{
console.log("2222");
}
})
})
</script>
</head>
<body>
<input type="radio" id="a" value="1" name="aa">有
<input type="radio" id="b" value="2" name="aa">无
</body>
</html>
相关文章:
- jquery获取单选按钮选中的值 2022-12-23
- .NET ------ 树形菜单,点击单选按钮触发相应事件 2022-12-23
- 如何判断单选按钮radio被选中 2021-11-30
- 【js/jquery常用方法】单选按钮选中项以及change事件 2021-11-22
- jquery 操作单选按钮 2022-01-12
- jQuery 单选按钮切换 2022-12-23
- 单选框按钮选中问题 六、jQuery获取循环中的选中单选按钮radio的值 2021-11-22
- 单选按钮和多选按钮 2021-07-09