Online Snippets Library

Get Selected Text of Dropdown in jQuery

To get selected text of dropdown we use text() function of jQuery.

Example

HTML
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"> </script>
<title>Get Selected Text of Dropdown in jQuery </title>
</head>
<body>
<select id="select">
  <option value="1">Text 1</option>
  <option value="2">Text 2</option>
</select>
<input id="button" type="button" value="Get Text" />
</body>
</html>
Javascript
  $(document).ready(function(){
    $("#button").click(function(){
    alert($('#select :selected').text());//id of dropdown
    });
    });