二级联动和获取对应的值
1.普通的下拉框
水果:
<select>
<option>香蕉</option>
<option>苹果</option>
<option>西瓜</option>
<option selected="selected">草莓</option> <!--代表选中这个-->
</select>
显示结果如下:(默认会选中草莓)
2.二级联动
话不多说,直接上代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>二级级联查询</title>
</head>
<body>
<select id="first" onChange="nextChange()">
<option selected="selected"></option>
<option>湛江</option>
<option>深圳</option>