Dropdown option groups. the displayed text. Suppose, you have a select element and you need to select one of its options based on one of its values. Hello seniors, The change event executes the code when you change the select box option. A multiple select box allows a user to select multiple options. We can select text or we can also find the position of a text in a drop down list using option:selected attribute or by using val() method in jQuery.. By using val() method : The val() method is an inbuilt method in jQuery which is used to return or set the value of attributes for the selected elements.. Syntax : $(selector).val(parameter) In this tutorial, learn how to get text of selected dropdown using jQuery. Lets say I have the following select element and I need to dynamically select the option with a value of 3, which would be the “Peach”. The short answer is: use jQuery text() and find() to find the selected option of the select box.. You also have to use the change event of jQuery. Here Mudassar Ahmed Khan has explained how to get selected option text of HTML SELECT using jQuery Follow @jQueryFaqs The below code snippet explains how to get the value of the option from HTML Select dropdown using jQuery In the case of a select dropdown, the returned value is the selected option “value”, not its text. In HTML, element: How to get selected value from the dropdown using jQuery code. Similarly, you can retrieve the selected values from multiple select boxes with a little trick. jQuery code snippet to loop select box options (drop down boxes) in a form to get the values and text for each option, manipulating values in form select boxes. Could you please help me with any working demo how can I get text of and option without using .text? To change the selected value of a drop-down list, use the val() method. I think I m gonna answer my own question: $('option:selected', 'select[name="options"]').removeAttr('selected'); $('select[name="options"]').find('option[value="3"]').attr("selected",true); $('select[name="options"]').find('option:contains("Blue")').attr("selected",true); If they don't you can let us know what browser you are using so we can take note of it. To display the selected option in a dropdown list with JavaScript, you can try to run the following code. How to dynamically select option in dropdown menu? With jQuery, you can use `text()` or `html()` method to get the selected text from a drop-down. I would not expect this to work since text is not an attribute of