javascript get selected option value onchange

In JavaScript, selectedIndex property is used to set the value of a select box element. The HTMLSelectElement.selectedIndex property is a long that reflects the index of the first or last selected <option> element, depending on the value of multiple. $("#ddlViewBy :selected").val() not without selected. To subscribe to this RSS feed, copy and paste this URL into your RSS reader. When an item is selected in the HTML Select DropDownList, the jQuery OnChange event handler is executed within which the Text and Value of the selected item is fetched and displayed in JavaScript alert message box. Once I get a value from a dropdown menu can I compare it with a string? Example: In this example, we are using . change the select option using jquery. I think this solution is better than usign focus() and change() 'cause it relies on jquery for browser compatibility raither then the correct flow ef execution of both methods, @coorasse: the correct flow of execution could never be any different. Asking for help, clarification, or responding to other answers. is there a chinese version of ex. You can get the value from the select element by passing "this.value" as a parameter to your function named test(this.value) and after that Which