zoukankan      html  css  js  c++  java
  • output标签

    output

    output 标签定义不同类型的输出,比如脚本的输出。例如:

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Chapter3</title>
    <style type="text/css">
    label{
    	display: inline-block;
    	 60px;
    }
    </style>
    <script type="text/javascript">
    function CalculateBMI(feet,inches,pounds,resultElementName){
    	inches=Number(inches)
    	pounds=Number(pounds)
    	feet=Number(feet)
    
    	var totalInches=(feet*12)+inches
    	var resultElement=document.getElementById(resultElementName)
    	resultElement.innerHTML=Math.round(pounds*703*10/totalInches/totalInches)/10
    }
    </script>
    </head>
    
    <body>
    
    <h1>Body Mass Index Calculator</h1>
    
    <form action="#" id="bmiCalculator">
    
    <label for="feet inches ">Height:</label>
    
    <input name="feet">feet<br>
    
    <label></label>
    
    <input name="inches">inches<br>
    
    <label for="pounds">Weight:</label>
    
    <input name="pounds">pounds<br><br>
    
    <input type="button" name="calc" value="Calculate" onclick="CalculateBMI(this.form.feet.value,this.form.inches.value,this.form.pounds.value,'result')">
    
    </form>
    
    <p>Your BMI:<output id="result"></output></p>
    
    <table cellpadding="5" cellspacing="0" border="1">
    <tr>
       <td><b>BMI</b></td>
       <td><b>Weight Status</b></td>
     </tr>
     <tr>
       <td>Below 18.5</td>
       <td>Underweight</td>
     </tr>
     <tr>
       <td>18.5 &#8211; 24.9</td>
       <td>Normal</td>
     </tr>
     <tr>
       <td>25.0 &#8211; 29.9</td>
       <td>Overweight</td>
     </tr>
     <tr>
       <td>30.0 and Above</td>
       <td>Obese</td>
     </tr>
    
    </table>
    </body>
    </html>
    

    HTML output 标签

  • 相关阅读:
    解决Maven关于本地jar包的打包处理
    微信公众帐号应用开发—本地调试
    字符串
    动态类型
    数字
    React文档(二十四)高阶组件
    React文档(二十三)Web Components
    React文档(二十二)context
    React文档(二十一)协调
    React文档(二十)不使用JSX
  • 原文地址:https://www.cnblogs.com/masai1969/p/4355654.html
Copyright © 2011-2022 走看看