0
<select id="placeSelect"  onchange="map_place_change();" > 
<option value="CN">China</option>
<option value="WORD">world</option>
</select>

when i select a value , how can i get it ? such , how can i get "CN" , how can i get "china" ?

thanks ?

mike
  • 1,127
  • 4
  • 17
  • 34
  • possible duplicate of [jquery get selected text from dropdownlist](http://stackoverflow.com/questions/1643227/jquery-get-selected-text-from-dropdownlist) and [To get selected value of a dropdown (` – Felix Kling Apr 22 '11 at 08:18

4 Answers4

2
$("#placeSelect").val()

$("#placeSelect option:selected").text()
alexl
  • 6,841
  • 3
  • 24
  • 29
1

you need to use following code:

function map_place_change(){
    var value = $(this).val(); // value = "CN"
    var text = $(this).find("option:selected").text();// China
}
Andrei Andrushkevich
  • 9,905
  • 4
  • 31
  • 42
0
$('#placeSelect').change(function(){
  alert($('#placeSelect option:selected').html());
});

your function would be something like:

function map_place_change(){
    alert($('#placeSelect option:selected').html());
}
Headshota
  • 21,021
  • 11
  • 61
  • 82
-1

Try this

$(‘#’).find(“input[CHECKED]“).val()
Developer
  • 8,390
  • 41
  • 129
  • 238