js获取select标签选中的值 var obj = document.getElementById(”testSelect”); var index = obj.selectedIndex; var text = obj.options[index].text; var value = obj.options[index].value; jQuery中获得选中select值 $('#testSelect option:selected').text();//文本 $('#testSelect'
var obj = document.getElementByIdx_x(”testSelect”); //定位id var index = obj.selectedIndex; // 选中索引 var text = obj.options[index].text; // 选中文本 var value = obj.options[index].value; // 选中值 jQuery中获得选中select值 第一种方式$('#testSelect option:selected').text()
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><h