<input type="radio" name="sort" value="2" id="myradio">
How do I make this checked in JQUERY?
<input type="radio" name="sort" value="2" id="myradio">
How do I make this checked in JQUERY?
Really, there's no need for jQuery here: it will be slower, introduce a needless framework dependency and increase the possibility of error. The DOM method for this is also as clear and readable as it could be, and works in all the major browsers back to the 1990s:
document.getElementById("myradio").checked = true;
If you must use jQuery then I'd stop at just using it to get hold of the element:
$("#myradio")[0].checked = true;
In addition to using id...
$('input[name="sort"]').attr('checked',true);
$('input[value="2"]').attr('checked',true);