The example in this article describes the method of obtaining the select value in javascript. Share it with everyone for your reference. The specific analysis is as follows:
1. Get the displayed Chinese characters
2. Get the id in the database
3. Get the index id assigned by the select group
Example:
<select name="bigclass" id="bigclass" onChange="javascript:updatePage2();"> <option value="" selected="selected">ajax实验</option> <option value="4">我适宜市哈</option> </select>
Use:
The result is: I am suitable for the city
Use:
The result is: 4
Use:
The result is: 1
I hope this article will be helpful to everyone’s JavaScript programming design.