⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 health.html

📁 该网上论坛除了包含数据库之外,还有能够成功地进行信息上传及返回
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>健康体重计</title>
<style type="text/css">
<!--
.STYLE5 {
	font-size: x-large;
	font-weight: bold;
	font-family: Geneva, Arial, Helvetica, sans-serif;
}
-->
</style>
<script language="javascript">

   function mod(div,base){
   		return  Math.round(div - Math.floor(div/base)*base);
   }
   
   function calc(){
   		var w = document.form.weight.value * 1;
		var heightFeetIni = document.form.feet.value * 1;
		var heightInchesIni = document.form.inches.value * 1;
		var heightFeetConvert = heightFeetIni * 12;
		var h = heightFeetConvert+heightInchesIni;
		flag = (Math.round((w*703)/(h*h)));
		document.form.answer.value = flag;
	  

        var f = true;
		
		if((w<=25)||(w>=300)||(h<=48)||(h>=120)){
			alert("这个值也太夸张啦!");
			f = false;
		}
		if(f){
			 if(heightInchesIni>11){
			    var remindInches = mod(heightInchesIni,12);
			 `	document.form.inches.value = remindInches;
			    document.form.feet.value = heightFeetIni +((heightInchesIni-remindInches)/12);
				document.form.answer.value = flag;
			 }
	
		if(flag<19)  document.form.content.value = "得小心刮风下雨的天气呀!";
		if(flag>=19&&flag<=25)  document.form.content.value = "身体不错,继续保持呀!";
		if(flag>26&&flag<=29)  document.form.content.value = "得注意不能任其自由发展!";
		if(flag>=30&&flag<=40)  document.form.content.value = "不得不承认自己是个胖小伙!";
	    if(flag>40)  document.form.content.value = "是该减肥啦!";
		document.form.answer.value = flag;
		}
	return f;
   }
  
</script>
</head>

<body>
<form name="form" >
  <table width="255" border="1" align="center" bgcolor="#FFFFCC">
   <tr>
      <td>&nbsp;</td>
      <td align="left"><label><span class="STYLE5">体重测量计</span></label></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>你的体重:</td>
      <td><label>
        <input name="weight" type="text" size="3" />
      公斤</label></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>你的身高:</td>
      <td><label>
        <input name="feet" type="text" size="3" />
        英尺
        <input name="inches" type="text" size="3" />
      英寸</label></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><label>
        <input name="按钮" type="button" onclick="calc()" value="计算"/>
      </label></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>肥胖指数:</td>
      <td><label>
        <input name="answer" type="text" size="10" />
      </label></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>结论:</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td width="0" height="0">&nbsp;</td>
	  <td align="left"><label>
	    <input name="content" type="text" size="20" />
	  </label></td>
    </tr>
   
  </table>
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -