JQuery: Get Selected Value from RadioButtonList

Posted by Unknown On Wednesday, July 15, 2015 0 comments
Asp.net Code

  <asp:RadioButtonList ID="radFruits" runat="server">
     <asp:ListItem Text="Mango" Value="1" />
     <asp:ListItem Text="Apple" Selected="True" Value="2" />
     <asp:ListItem Text="Banana" Value="3" />
     <asp:ListItem Text="Guava" Value="4" />
  </asp:RadioButtonList>

JQuery

   var radio = $("[id*=radFruits] input:checked");
   var value = radio.val();

0 comments:

Post a Comment