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

  • 相关阅读:
    poj 3258
    CodeForces 367E Sereja and Intervals
    Codeforces Round #240 (Div. 2) C Mashmokh and Numbers
    Codeforces Round #240 (Div. 2) D
    zoj 3768 Continuous Login
    2014/4/4做题感悟
    HDU 1878 欧拉回路
    HDU 3018 Ant Trip
    POJ 3694 Network
    Codeforces Round #239 (Div. 2)
  • 原文地址:https://www.cnblogs.com/masai1969/p/4355654.html
Copyright © 2011-2022 走看看