资料
表格
制度
合同
管理
职场
经营
创业
范文
总结
计划
作文
文章
美文
词句
教程
模板
图片
字体
图标
办公
人事
财务
生产
管理资源吧首页
>>>
教程
>>>
编程
>>>
JavaScript教程
>>>
用js实现的生肖查询的代码
效果图:
演示代码:
<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> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3CSCRIPT%20language%3DJavaScript%3E%20%0D%0A%3C!--%20%0D%0Afunction%20getpet%20()%20%7B%20%0D%0Avar%20toyear%20%3D%201997%3B%20%0D%0Avar%20birthyear%20%3D%20document.frm.inyear.value%3B%20%0D%0Avar%20birthpet%3D%22Ox%22%20%0D%0Ax%20%3D%20(toyear%20-%20birthyear)%20%25%2012%20%0D%0Aif%20((x%20%3D%3D%201)%20%7C%7C%20(x%20%3D%3D%20-11))%20%7B%20%0D%0Abirthpet%3D%22%E9%BC%A0%22%20%7D%20%0D%0Aelse%20%7B%20%0D%0Aif%20(x%20%3D%3D%200)%20%7B%20%0D%0Abirthpet%3D%22%E7%89%9B%22%20%7D%20%0D%0Aelse%20%7B%20%0D%0Aif%20((x%20%3D%3D%2011)%20%7C%7C%20(x%20%3D%3D%20-1))%20%7B%20%0D%0Abirthpet%3D%22%E8%99%8E%22%20%7D%20%0D%0Aelse%20%7B%20%0D%0Aif%20((x%20%3D%3D%2010)%20%7C%7C%20(x%20%3D%3D%20-2))%20%7B%20%0D%0Abirthpet%3D%22%E5%85%94%22%20%7D%20%0D%0Aelse%20%7B%20%0D%0Aif%20((x%20%3D%3D%209)%20%7C%7C%20(x%20%3D%3D%20-3))%20%7B%20%0D%0Abirthpet%3D%22%E9%BE%99%22%20%7D%20%0D%0Aelse%20%7B%20%0D%0Aif%20((x%20%3D%3D%208)%20%7C%7C%20(x%20%3D%3D%20-4))%20%7B%20%0D%0Abirthpet%3D%22%E8%9B%87%22%20%7D%20%0D%0Aelse%20%7B%20%0D%0Aif%20((x%20%3D%3D%207)%20%7C%7C%20(x%20%3D%3D%20-5))%20%7B%20%0D%0Abirthpet%3D%22%E9%A9%AC%22%20%7D%20%0D%0Aelse%20%7B%20%0D%0Aif%20((x%20%3D%3D%206)%20%7C%7C%20(x%20%3D%3D%20-6))%20%7B%20%0D%0Abirthpet%3D%22%E7%BE%8A%22%20%7D%20%0D%0Aelse%20%7B%20%0D%0Aif%20((x%20%3D%3D%205)%20%7C%7C%20(x%20%3D%3D%20-7))%20%7B%20%0D%0Abirthpet%3D%22%E7%8C%B4%22%20%7D%20%0D%0Aelse%20%7B%20%0D%0Aif%20((x%20%3D%3D%204)%20%7C%7C%20(x%20%3D%3D%20-8))%20%7B%20%0D%0Abirthpet%3D%22%E9%B8%A1%22%20%7D%20%0D%0Aelse%20%7B%20%0D%0Aif%20((x%20%3D%3D%203)%20%7C%7C%20(x%20%3D%3D%20-9))%20%7B%20%0D%0Abirthpet%3D%22%E7%8B%97%22%20%7D%20%0D%0Aelse%20%7B%20%0D%0Aif%20((x%20%3D%3D%202)%20%7C%7C%20(x%20%3D%3D%20-10))%20%7B%20%0D%0Abirthpet%3D%22%E7%8C%AA%22%20%7D%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%7D%20%0D%0Adocument.frm.birth.value%20%3D%20birthpet%3B%20%0D%0A%7D%20%0D%0A%2F%2F%20--%3E%20%0D%0A%3C%2FSCRIPT%3E"> </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="/" _ewebeditor_ta_href="%2F" target="_self">首页</a>></font></strong></font><a href="/tools" _ewebeditor_ta_href="%2Ftools" 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>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行
]
教程首页
更多教程