text syntax is below: var variableValue = $(“selector option: selected”).text(); The “option: selected” attribute is used to select specific content in the option tag. Unless explicitly stated otherwise, jQuery functions require primitive values where applicable, and do not accept their Object-wrapped forms. For example, using the following select box: 1. A multiple select box allows a user to select multiple options. Related Articles Get Selected Value of HTML SELECT using jQuery With this I was able to create a dynamic function that works with all my selection boxes that I want to get both values, the option value and the text. The text() method sets or returns the text content of the selected elements. Get selectbox value, get selectbox text, set selectbox value, set selectbox text, get selectedIndex, set selectedIndex ,etc. Java Program To Check A Number is Palindrome or Not, Check A Number Is Armstrong or Not Using Java Program, How to write your own atoi function in C++, The Javascript Prototype in action: Creating your own classes, Check for the standard password in Python using Sets, Generating first ten numbers of Pell series in Python, jQuery multiple events to trigger same function, Print content from a particular div element using jQuery. Now we are able to select an option by its text using the simple and easy to use jQuery code. So when we click on the button, our jQuery code will find the option from the select tag which contains “Option 2” and adds the attribute “selected”. See the demo online by clicking the link or image below: See the following code in the