作者:zhangsheng7_215 | 来源:互联网 | 2022-07-03 03:00
代码如下:
function xingzuo() {
var start = 1901, date=document.getElementById("txtDay").value, mOnth=document.getElementById("txtMonth").value;;
with (document.getElementById("txtXZ")){
if (mOnth== 1 && date >=20 || mOnth== 2 && date <=18) {value = "水瓶座";}
if (mOnth== 1 && date > 31) {value = "Huh?";}
if (mOnth== 2 && date >=19 || mOnth== 3 && date <=20) {value = "双鱼座";}
if (mOnth== 2 && date > 29) {value = "Say what?";}
if (mOnth== 3 && date >=21 || mOnth== 4 && date <=19) {value = "白羊座";}
if (mOnth== 3 && date > 31) {value = "OK. Whatever.";}
if (mOnth== 4 && date >=20 || mOnth== 5 && date <=20) {value = "金牛座";}
if (mOnth== 4 && date > 30) {value = "I'm soooo sorry!";}
if (mOnth== 5 && date >=21 || mOnth== 6 && date <=21) {value = "双子座";}
if (mOnth== 5 && date > 31) {value = "Umm ... no.";}
if (mOnth== 6 && date >=22 || mOnth== 7 && date <=22) {value = "巨蟹座";}
if (mOnth== 6 && date > 30) {value = "Sorry.";}
if (mOnth== 7 && date >=23 || mOnth== 8 && date <=22) {value = "狮子座";}
if (mOnth== 7 && date > 31) {value = "Excuse me?";}
if (mOnth== 8 && date >=23 || mOnth== 9 && date <=22) {value = "室女座";}
if (mOnth== 8 && date > 31) {value = "Yeah. Right.";}
if (mOnth== 9 && date >=23 || mOnth== 10 && date <=22) {value = "天秤座";}
if (mOnth== 9 && date > 30) {value = "Try Again.";}
if (mOnth== 10 && date >=23 || mOnth== 11 && date <=21) {value = "天蝎座";}
if (mOnth== 10 && date > 31) {value = "Forget it!";}
if (mOnth== 11 && date >=22 || mOnth== 12 && date <=21) {value = "人马座";}
if (mOnth== 11 && date > 30) {value = "Invalid Date";}
if (mOnth== 12 && date >=22 || mOnth== 1 && date <=19) {value = "摩羯座";}
if (mOnth== 12 && date > 31) {value = "No way!";}
}
}