You can either select text or find the position of it in a drop-down list by using the option:selected attribute or the val() method in jQuery. 1. for…of statement. It will return the value of the value attribute of the first matched element. Definition and Usage. How to Get the Value of Selected Option in a Select Box Using jQuery. When the Button is clicked, the GetSelectedTextValue JavaScript function is executed. Also the following code will help you to select item from selection option by index number. TAGs: JavaScript, jQuery, HTML, DropDownList Answer: Use the jQuery :selected Selector. The removeAll() function repeatedly removes the first option in the select box, therefore, it removes all the options. Get Value of Selected Radio Button. So, I want to have the corresponding option selected from its value. There is a text value property which can set and return the value of the value attribute of a text field.Also we can use jquery val() method inside script to get or set the value of text input field.. so I stored one variable as the name attribute and the other as the value attribute. Note: The value "-1" will deselect all options (if any). Each element in this list is a DOM