<select name="type" οnchange="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
转自:https://blog.csdn.net/rain097790/article/details/39993615