Copy Code code as follows:
var obj = document.getElementById ("Testselect"); Location ID
var index = Obj.selectedindex; Select Index
var text = Obj.options[index].text; Select text
var value = Obj.options[index].value; Checked values
Select Select Value obtained in jquery
The first way
Copy Code code as follows:
$ (' #testSelect option:selected '). text ();//Selected texts
$ (' #testSelect option:selected '). Val ();//Selected value
$ ("#testSelect"). Get (0). selectedindex;//Index
The second way
Copy Code code as follows:
$ ("#tesetSelect"). Find ("option:selected"). Text ();
$ ("#tesetSelect"). Find ("option:selected"). Val ();
$ ("#tesetSelect"). Find ("option:selected"). Get (0). SelectedIndex;
The above is JavaScript to get the Select tag selected value of the entire content, I hope to give you a reference, but also hope that we support the cloud habitat community.