If this code checks the value of a radio button, what do I change if I need to check the value of a drop down box?
var checker= jq('input[name="radioname"]:radio:checked').attr("val");
If this code checks the value of a radio button, what do I change if I need to check the value of a drop down box?
var checker= jq('input[name="radioname"]:radio:checked').attr("val");
Try that :)
$(':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