By using the $.val method of jQuery, you may get the value of any input form controls including HTML select. I will add. answered Feb 20 '13 at 9:38. sasi sasi. The JQuery change () event occurs when the value of an HTML element changes. jquery select change event get selected option. In jQuery – How to get and set data-attribute, data attribute id, data-attribute text etc. $ (" #dropdownList ") .val (); The second one is the text value of the select element. Note: For select menus, the change event occurs when an option is selected. For text field or text fields, the occurrence of change occurs when the field loses focus after the content changes. Used Function: The change event executes the code when you change the select box option. Get Selected Value Text Select Value 0 Option value 8 Option value 5 Option value 4 function singleSelectChangeText() { //Getting Value var selObj = document.getElementById("singleSelectTextDDJS"); var selValue = selObj.options[selObj.selectedIndex].text; //Setting Value … Now we are able to select an option by its text using the simple and easy to use jQuery code. Your email address will not be published. jQuery Practical Exercises with Solution: Change options of select using jQuery. Save my name, email, and website in this browser for the next time I comment. textarea-Elementen.) jQuery core Exercises with Solution: Find the specific option tag text value of a selected option. It only works on the form fields. Here the one line code is: $("#myDropdown option:contains(Option 2)").attr('selected', 'selected'); The code adding the attribute “selected” to the option contains the text “Option … Given below jQuery select change function’s syntax: $ ("select").change (function () { // Do something here. } To achieve this feat you can use various methods, two of those methods will be explained below. You will Step By Step learn web programming, easy and very fun. By Atul Rai | April 27, 2017 | Updated: July 20, 2018 Previous Next . Thanks.----Update----If my script looks like this: When the change event occurs, the change method attaches a function with it to run. https://makitweb.com/change-selected-option-in-select2-dropdown-with-jquery Topic: JavaScript / jQuery Prev|Next. Android xml design slowing down my application, Passy password generator with boolean parameters, Dashboard Header button and footer button not getting aligned properly in concrete 5, Laravel 8 - Automatically update a form field when certain value is selected, working but need to get that piece from mysql. 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. How do I get the text value of a selected option? Note: This event is limited to elements,