1$(document).ready(function() {
2 $("#gate option[value='Gateway 2']").prop('selected', true);
3 // you need to specify id of combo to set right combo, if more than one combo
4});
5
1$("select.country").change(function(){
2 var selectedCountry = $(this).children("option:selected").val();
3 alert("You have selected the country - " + selectedCountry);
4});
1<select id="myselect">
2 <option value="1">Mr</option>
3 <option value="2" selected="selected">Mrs</option>
4 <option value="3">Ms</option>
5 <option value="4">Dr</option>
6 <option value="5">Prof</option>
7</select>
8
9<script>
10 alert($( "#myselect" ).val()); //alert '2'
11 //OR
12 alert($( "#myselect option:selected" ).attr('value')); //alert '2'
13
14 //Use this if you want to get the label and not the value
15 alert($( "#myselect option:selected" ).text()); //alert 'Mrs'
16</script>