用js实现的生肖查询的代码
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了用js实现的生肖查询的代码,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2776字,纯文字阅读大概需要4分钟。
内容图文
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>生肖查询</title> <style type="text/css"> <!-- td,body {font-size:12px} a:link {color:#000000;text-decoration:none} a:visited {color:#000000;text-decoration:none} a:active {color:blue;text-decoration:none} a:hover {color:red;text-decoration:underline} a.title:link {color:#000000;text-decoration:underline} a.title:visited {color:#000000;text-decoration:underline} a.title:active {color:#0000ff;text-decoration:underline} a.title:hover {color:#0000ff;text-decoration:underline} --> </style> <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> </head> <table width="760" height="22" border="1" align="center" cellpadding="1" cellspacing="0" bordercolor="#aaaaaa" bordercolordark="#ffffff"> <tbody> <tr> <td height="20" align="center"><table width="100%" border="0"> <tr> <td width="54%"><b><font color="#424242"><strong><font color="#424242">目前位置>><a href="/" target="_self">首页</a>></font></strong></font><a href="/tools" target="_self">实用查询</a>>生肖查询</b></td> <td width="46%"> </td> </tr> </table></td> </tr> </tbody> </table> <table width="760" border="0" align="center" cellspacing="0"> <tr> <td width="760" height="10"></td> </tr> </table> <DIV align=center><span class="style2"> 生肖查询</span></div> <P align=center> <FORM name=frm> <div align="center">生于: <INPUT size=4 value=1986 name=inyear> 年 <INPUT onclick=getpet() type=button value=查看生肖> 属: <INPUT size=3 name=birth> </div> </FORM><TR> <TD width="100%" height="6" align="center" bgcolor="#FFFFFF"><FONT color=#ff0000> </TD> </TR> <TR> <TD align="center" height="5" width="100%"> </TD> </TR></P> <div align="center"><span class="style1">当然没有人回忘记自己属什么。。但是你可以很轻松得知道任何年份出世得人的属相。。填入查询出生在哪一年,例如:"1986"</span> </div> <p> </p> </body> </html>
内容总结
以上是互联网集市为您收集整理的用js实现的生肖查询的代码全部内容,希望文章能够帮你解决用js实现的生肖查询的代码所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。