js根据日期判断星座的示例代码
2014-01-23 09:56
579 查看
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!";} } }
相关文章推荐
- js根据日期判断星座的示例代码
- js根据日期判断星座
- js 日期计算星座 根据生日的月份和日期,一行代码计算星座的js小函数(转)
- 根据生日的月份和日期,一行代码计算星座的js小函数(转)
- 根据出生日期自动取得星座的js代码
- JS判断两个时间大小的示例代码
- Java代码积累:根据日期判断出星期几
- js字符串日期yyyy-MM-dd转化为date示例代码
- js判断60秒以及倒计时示例代码
- php根据日期判断星座的函数分享
- javascript 判断两个日期之差的示例代码
- js获取判断上传文件后缀名的示例代码
- js 判断文件类型并控制表单提交示例代码
- JS比较2个日期间隔的示例代码
- js根据手机客户端浏览器类型,判断跳转官网/手机网站多个实例代码
- JS判断当前日期是否大于某个日期的实现代码
- js日期、星座的级联显示代码
- JS判断两个时间大小的示例代码
- JS判断当前日期是否大于某个日期的实现代码
- js判断IE浏览器版本过低示例代码