获取 select option text


获取select name的text值:

<select size="5" style="width: 100%; margin-bottom: 15px;" name="address_id">

<option value="20">falcon falcon, FALCON, FALCON, T'ai-chung, Taiwan</option>
<option selected="selected" value="21">adsf asdf , 22222, 22222, Appenzell Innerrhoden, Switzerland</option>
</select>
<script>
$(function(){
    $("select[name=address_id]").change(function(){
        var checkText=$("select[name=address_id]").find("option:selected").text();
    alert(checkText);
    });  
})

</script>


获取select 数组 name的text值:

$($("select[name=address_id]")[1]).find("option:selected").text()

你可能感兴趣的:(function)