引入jQuery类库:
jquery-1.6.1.js;
源代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<title>省市联动</title>
<script type="text/javascript" src="js/jquery-1.6.1.js"></script>
<script type="text/javascript">
//当季度变化时,被选项月份也会做出相应的变化
function quarterSelect(){
if($("#quarter option:selected").val()=="01"){
$("#month option").show();
for(var i=4;i<10;i++){
$("#month option[value='0"+i+"']").hide();
}
for(var i=10;i<13;i++){
$("#month option[value='"+i+"']").hide();
}
$("#month option:first").hide();
$("#month option[value='01'