HTML:
<select id=‘select‘> <option value=‘0‘>上海</option> <option value=‘1‘>北京</option> <option value=‘2‘>广州</option> </select>
JS:
$(‘#select‘).change(function(){ var oV=$(this).find(‘option:selected‘).val(); if(oV==0){ //.......... }else if(oV==1){ //.......... }else if(oV==2){ //.......... }; })
时间: 2024-10-10 20:47:00