jQuery get selected option text
jQuery get selected option text: You can get selected option text in select box as below.
Syntax : jQuery get selected option text
Syntax to get selected option textof dropdown menu can be as :
Suppose we have following drop down list
<select id="demo"> <option value="0">first</option> <option value="1">second</option> <option value="2">third</option> </select>
You can get selected value in jquery as :
$("#demo").change(function () { $("#demo :selected").text(); });
Advertisements
Add Comment
📖 Read More
- 1. JavaScript Get Timestamp
- 2. JavaScript get current url
- 3. Select element by data attribute in JavaScript
- 4. jQuery trigger function when element is in viewport
- 5. Bootstrap change tooltip content on click