-
<select name="type" onchange="show_sub(this.options[this.options.selectedIndex].value)">
-
<option value="0">请选择主类别</option>
-
<option value="1">1</option>
-
<option value="2">2</option>
-
</select>
show_sub的JS方法:
-
<script>
-
function show_sub(v){
-
alert(v);
-
}
-
</script>
最重要的知识点是获在select onchange时获取option的value值:
this.options[this.options.selectedIndex].value
转自:http://blog.micxp.com/index.php/archives/54/