js日期,星座的级联显示代码

JS代码
复制代码代码如下所示:
功能birthdayonchange(obj){
var = $( )值;

如果(年=年)
返回;
其他的
年= parseInt(年,10);


var = $( )值;
如果(月=月)
返回;
其他的
月= parseInt(月10);

var = $( )值;
VaR整天= getdays(年,月);

如果(1){
var选项= $( ))选项;
对于(var i = 1;i <一整天;i++){
Var J = i.toString ();
J = j.length = =0+ 1 J J;
options.length = I + 1;
选项{;
选项{文本};
如果(天<=整天我= =天){
选项{选择} =真;
}
}
}
}

功能getdays(年、月){
Var dayarr = new Array (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

如果(月= 2){
如果(年% = 4 = 0年% 100!= 0)| |年% 400 = = 0 | |年<1900)
返回29;
其他的
dayarr { 1 }月收益;
}
{其他
dayarr { 1 }月收益;
}
}

功能adjustastro(){
无功v_astro = getastro($()。值,$()。值);
$()。选项{ 0 }。文本= v_astro;
}

功能getastro(v_month,v_day){
v_month = parseInt(v_month,10)
v_day = parseInt(v_day,10);

如果(v_month = = 12(v_day > = 22)
| |(v_month = = 1){ v_day < = 20)
返回摩羯;
}
如果(v_month = = 1(v_day > = 21)
|| (v_month = = 2) {v_day < = 19)
返回水瓶座;
}
如果(v_month = = 2(v_day > = 20)
| |(v_month = = 3){ v_day < = 20)
返回双鱼座;
}
如果(v_month = = 3(v_day > = 21)
| |(v_month = = 4){ v_day < = 20)
返回白羊座;
}
如果(v_month = = 4(v_day > = 21)
| |(v_month = = 5){ v_day < = 21)
返回金牛座;
}
如果(v_month = = 5(v_day > = 22)
| |(v_month = = 6){ v_day < = 21)
返回双子座;
}
如果(v_month = = 6(v_day > = 22)
| |(v_month = = 7){ v_day < = 22)
返回癌症;
}
如果(v_month = = 7(v_day > = 23)
| |(v_month = = 8){ v_day < = 23)
返回狮子;
}
如果(v_month = = 8(v_day > = 24)
| |(v_month = = 9){ v_day < = 23)
返回处女座;
}
如果(v_month = = 9(v_day > = 24)
| |(v_month = = 10){ v_day < = 23)
返回天秤座;
}
如果(v_month = = 10(v_day > = 24)
| |(v_month = = 11){ v_day < = 22)
返回天蝎座;
}
如果(v_month = = 11(v_day > = 23)
| |(v_month = = 12){ v_day < = 21)
返回射手;
}
返回;
}

HTML
复制代码代码如下所示:
出生日期:uff1a



白天


星座:


处女座