jquery 怎样获取select 的id?
例如:<td><label for="area_code">地区:</label></td>
<td >
<select id="area_code" name="area_code">
</select>
</td>
我想在javascript中获取"area_code" 这个字符串,怎么获取?
例如:<td><label for="area_code">地区:</label></td>
<td >
<select id="area_code" name="area_code">
</select>
</td>
我想在javascript中获取"area_code" 这个字符串,怎么获取?
$(#testSelect option:selected').text();
或$("#testSelect").find('option:selected').text();
或$("#testSelect").val();应该都可以吧