如果此代码检查单选按钮的值,如果需要检查下拉框的值,我该如何更改?
var checker= jq('input[name="radioname"]:radio:checked').attr("val");
答案 0 :(得分:1)
var selecter = jq('select[name="selectname"]').val();
答案 1 :(得分:0)
试试:)
$(':radio[name="sex"][value="male"]').prop("checked", true);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Sex : <input type="radio" name="sex" value="male">Male
<input type="radio" name="sex" value="female" checked="checked">Female