Saturday, November 23, 2013

Jquery to get selected value from dropdown in

1 comment
Jquery code can be used to get the selected value from drop down list control. In this example I am displaying the selected text of drop down list on  the click of button control click event using jquery.

Jquery Code to Show Selected Value of Drop Down List control of

<html xmlns="">
<head runat="server">
<script type="text/javascript" src="//""></script>
<script type="text/javascript">
$(document).ready(function () {
$('#btngetval').click(function () {
var selectedval = $('#DropDownList1 option:selected').text();
<form id="form1" runat="server">
<asp:DropDownList ID="DropDownList1" runat="server" ClientIDMode="Static">
<asp:Button runat="server" ID="btngetval" Text="Submit"  />

1 comment:

  1. You're not getting the "value" in your code. You're getting the "text". Value and text are different.