js獲取table中選中行的數(shù)據(jù) 用js獲取select的多個選項(xiàng)值?
用js獲取select的多個選項(xiàng)值?以下兩種使用js獲取select的方法如下:VAR obj=document.getElementByIdxX(“testselect”)來定位idvar索引=對象
用js獲取select的多個選項(xiàng)值?
以下兩種使用js獲取select的方法如下:VAR obj=document.getElementByIdxX(“testselect”)來定位idvar索引=對象選擇索引選擇索引變量文本=對象選項(xiàng)[索引]。text選擇文本變量值=對象選項(xiàng)[索引]。Value在jQuery中獲取所選select值的第一種方法是$(“#testselect)選項(xiàng):選中"). Text()所選文本$(“#testselect)選項(xiàng):選中"). Val()選定值$(“#testselect”)。獲?。?)。selectedindex索引的第二種方式是$(“#tesetselect”)。查找(“選項(xiàng):選中"). Text()//selected Text.val()…….get(0).selectedIndex