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 标签

  • 相关阅读:
    C# 文件类的操作---删除
    C#实现Zip压缩解压实例
    UVALIVE 2431 Binary Stirling Numbers
    UVA 10570 meeting with aliens
    UVA 306 Cipher
    UVA 10994 Simple Addition
    UVA 696 How Many Knights
    UVA 10205 Stack 'em Up
    UVA 11125 Arrange Some Marbles
    UVA 10912 Simple Minded Hashing
  • 原文地址:https://www.cnblogs.com/masai1969/p/4355654.html
Copyright © 2011-2022 走看看