Copy Code code as follows:
<%@ Page language= "C #" autoeventwireup= "true" codebehind= "Default.aspx.cs" inherits= "Web.default"%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<title></title>
<script src= "Jquery-1.8.2.min.js" type= "Text/javascript" ></script>
<link href= "Base.css" rel= "stylesheet" type= "Text/css"/>
<style type= "Text/css" >
</style>
<script type= "Text/javascript" >
$ (document). Ready (function () {
$ ("#<%=rblhobbies.clientid%> Input[type=radio]"). Bind ("Change", function () {
if ($ (this). Val ()!= "") {
$ ("#message"). Text ("Text:" + $ (this). Next (). Text () + "Value:" +$ (This). Val ());
}
});
});
</script>
<body>
<form id= "Form1" runat= "Server" >
<div style= "margin:100px auto; width:400px; height:200px; " >
<fieldset style= "width:400px; height:150px ">
<p>
Please choose Hobby </p>
<asp:radiobuttonlist id= "rblhobbies" runat= "Server" >
<asp:listitem value= "1" > Music </asp:ListItem>
<asp:listitem value= "2" > Basketball </asp:ListItem>
<asp:listitem value= "3" > American drama </asp:ListItem>
<asp:listitem value= "4" > Film </asp:ListItem>
</asp:radiobuttonlist >
</fieldset>
<br/>
<div id= "message" style= "Color:blue;" ></div>
</div>
</form>
</body>