I am trying to set a specific radio buttom item to be checked using JQuery when the page loads.
Can this be done with jquery?
$(function () {
$("#myRadioId").prop("checked", true);
});
This is so easily googled, the best way to learn is to try it your self. We only get better by working things out.
http://api.jquery.com/ready/
http://api.jquery.com/prop/
$(document).ready(function() {
$("#your id").prop("checked", true);
});
$(document).ready(function() {
$("#yourRadioButtonId").attr("checked", "checked");
//Or
$("#yourRadioButtonId").prop("checked",true);
});
$(document).ready(function() {
$('radio-selector[name="the-value-to-set"]').attr('checked', 'checked');
});