Get text of the selected option with jQuery [duplicate] Ask Question Asked 9 years, 5 months ago. The :selected selector selects option elements that are pre-selected. Click each button for the currently selected value of the radio button. The second one is the text value of the select element. Active 3 years, 10 months ago. 4. 2. Note: This selector will not work on checkboxes or radio buttons. The .val() method is primarily used to get the values of form elements such as input, select and textarea.When called on an empty collection, it returns undefined.. At times, it could be very useful to use jQuery to Get Selected Option Index value for carrying out relevant processing. Get selectbox value, get selectbox text, set selectbox value, set selectbox text, get selectedIndex, set selectedIndex ,etc. If you want to get the text not the value of the selected option in jQuery, you can use the $.text method. Select your option from the select box to execute the code and get the text of selected option content. The selected option’s value is displayed in a simple alert. Syntax In this article, I am going to show you a very easy and simple way to get selected option index value using jQuery.And the actual code is just 1 line, so it’s super easy to follow and implement. Viewed 109k times 49. However, there are two types of select box. You can see, the alert shows the value behind each visible text, not the text itself. You can also get the value of the selected radio button using the selector :checked with the function val(). 1- val() – method returns the value of selected attribute value. Model : A simple Model which has Country ID, Country Name and SelectedCounty. The above example contains the select dropdown option and jQuery change event. You will get the output in the div element using the jQuery html(). When the button is clicked the text or inner HTML of the selected option of the HTML Select Dropdown with ID mySelect is fetched and displayed in alert. However, you can also get this output in the alert message as per your requirement. The button with ID demo is attached with a click event. The first is the single option selection select box and other is the multiple option select box. Use the :checked selector instead. jquery how to get data attribute value of selected option - gist:0197352f3b0daf0666ef var selectedVal = $("#myselect option:selected").val(); An example to get the text of selected option. In this post, we are going to discuss how to get the drop down selected value using Asp.Net MVC razor and jquery. In the example code, we will show how you can get the text value of the select using jQuery. public c jQuery provides two methods to get the value of the selected option from the select box. Getting and setting the value and the text of a selectbox using jQuery is very simple. The following select box has some options with values, the text value of the selected option will be retrieved from this select element. You have to use the jquery change method to Get Select Box Option Value on select of the options. You may also like how to show/hide div on dropdown selected using jQuery. In this example, we are going to help to get the value of the selected option in the select box using jQuery. Use checked selector with val() to Get Selected Radio Button Value. using jQuery are mentioned in this article.