JS get Select drop-down box the value value of each option is relatively easy, but getting the text value is a bit of a hassle, for a beginner JavaScript novice, may not be able to find a moment, then please look at the method of this article, Take the Select drop-down box menu in a form form as an example of how to get its value and text values in javascript:
Sample form, which is a select drop-down list box with individual list items and values:
<formname= "Form1"><Selectname= "TestValue"><optionvalue= "ASP">Asp</option><optionvalue= "PHP">Php</option><optionvalue= "JSP">Jsp</option></Select></form>
Next is the JavaScript section, which gets the individual value and text values for select:
// gets the value of the Select drop-down box option: Document.form1.testvalue.value // gets the text value of the Select drop-down box option:Document.form1.testvalue.options[document.form1.testvalue.selectedindex]. Text
Method for JavaScript to get the value and text value of select dropdown box option