<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>获取下拉列表选中项的value</title>
</head>
<body>
<script type="text/javascript">
window.onload = function(){
var provinceListElt = document.getElementById("provinceList");
provinceListElt.onchange = function(){
// 获取选中项的value
alert(provinceListElt.value);
}
}
</script>
<select id="provinceList">
<option value="">--请选择省份--</option>
<option value="001">河北省</option>
<option value="002">河南省</option>
<option value="003">山东省</option>
<option value="004">山西省</option>
</select>
</body>
</html>
JS获取下拉列表选中项的value
于 2022-09-01 13:18:12 首次发布