1. 程式人生 > >獲取select標簽中option的value值

獲取select標簽中option的value值

each val var scrip blog true teacher highlight log

<select id="teacher" name="tea-list" form="">
    <option value="none">請選擇老師</option>
    <option value="1">老師1</option>
</select>
//獲取select標簽中option的value值

var $teacher=$(‘#teacher option:selected‘);
$teacher.val()

  

獲取select標簽中option的value值