学习首页 百科 人生课堂 办公软件 英语学习 操作系统 故事会 编程资料 软件学习 设计
铭瑶网 >> 学习首页 >> 编程 >> 猜你的属相
标题:猜你的属相

【字体: 】 时间:2008-4-11 来源:互联网 作者:study

猜你的属相

<html><head><title>猜你的属相</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head> <body   bgcolor=#FFFFFF  ><!--------------------------------><SCRIPT language=JavaScript> <!-- function getpet () {          var toyear = 1997;         var birthyear = document.frm.inyear.value;         var birthpet="Ox"          x = (toyear - birthyear) % 12         if ((x == 1) || (x == -11)) {             birthpet="您属老鼠"      }             else  {              if (x == 0)             {              birthpet="您属牛"           }              else  {               if ((x == 11) || (x == -1)) {               birthpet="您属老虎"          }               else  {                if ((x == 10) || (x == -2)) {                birthpet="您属兔子"         }                else  {                 if ((x == 9) || (x == -3))  {                 birthpet="您属龙"         }                 else  {                  if ((x == 8) || (x == -4))  {                   birthpet="您属蛇"      }                  else  {                   if ((x == 7) || (x == -5))  {                    birthpet="您属马"      }                   else  {                    if ((x == 6) || (x == -6))  {                     birthpet="您属羊"      }                    else  {                     if ((x == 5) || (x == -7))  {                       birthpet="您属猴"     }                     else  {                      if ((x == 4) || (x == -8))  {                      birthpet="您属鸡"    }                      else  {                       if ((x == 3) || (x == -9))  {                       birthpet="您属狗"        }                       else  {                        if ((x == 2) || (x == -10))  {                        birthpet="您属猪"         }                         }                      }                     }                    }                   }                  }                 }                }               }              }             }         document.frm.birth.value = birthpet;  } // --> </SCRIPT><FORM name=frm>出生年份:<INPUT name=inyear size=4 value=1975> <BR><INPUT onclick=getpet() type=button value=看看属什么><INPUT name=birth size=9></FORM><!----------------------------------></body></html>

查看/参与:讨论/评论 相关文章:Javascript