The below code snippet explains how to find and check or select HTML radio button based on its name and value using jQuery
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$("#demo").live("click", function () {
$("input[name=fruits][value=2]").attr("checked", "checked");
});
</script>
</head>
<body>
<form id="form1" runat="server">
<input type = "radio" name = "fruits" value = "1" />Mango<br />
<input type = "radio" name = "fruits" value = "2" />Apple<br />
<input type = "radio" name = "fruits" value = "3" />Banana<br />
<br /><br />
<input type = "button" id = "demo" value = "Select Apple" />
</form>
</body>
</html>
Explanation:
In the above code snippet I am assigning click event handler to the HTML input button with Id demo. When this button is clicked it first finds the HTML radio buttons with name fruits and then within them it finds the HTML radio button with value 2 and then sets its checked attribute using the jQuery selector input[name=fruits][value=2]"..
Demo:
Mango
Apple
Banana