»
EnglishFrenchVietnamese

Print - Inches and Centimeters - JavaScriptBank.com

Full version: jsB@nk » Calculation » Equivalent » Inches and Centimeters
URL: https://www.javascriptbank.com/inches-and-centimeters.html

Inches and Centimeters © JavaScriptBank.comChange inches to centimeters and back using this short, sweet script. Very easy to use, just type in the number and click.

Full version: jsB@nk » Calculation » Equivalent » Inches and Centimeters
URL: https://www.javascriptbank.com/inches-and-centimeters.html



CSS
<style type=text/css>input.convert {  color: #fff;  background-color: #00009C;  border: 1px insert #000;  font-weight: bold;}input.boxes {  border: 0em;}</style><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


JavaScript
<script type=text/javascript>// Created by: Delan Ahmad :: http://users.bmail.com.au/azabani/function cnvrtb() {  document.getElementById("theIBox").value=document.getElementById("theBox").value/2.54;}function cnvrta() {  document.getElementById("theCBox").value=document.getElementById("theBox").value*2.54;}</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<form id="theForm"><table border="0" cellpadding="0" cellspacing="5" align="center" width="25%">  <tr>    <td>      <strong>Number to Convert:</strong></td>    <td align="right"><input type="text" id="theBox" size="5" value="0">    </td></tr>    <tr><td>      <input type="button" class="convert" value="Convert to Inches" id="R2" onclick="cnvrtb()"></td>      <td align="right"><input type="text" class="boxes" id="theIBox" size="5" value="0" readonly></td>    </td></tr>    <tr><td>      <input type="button" class="convert" id="R1" value="Convert to Centimeters" onclick="cnvrta()">      <td align="right"><input type="text" class="boxes" id="theCBox" size="5" value="0" readonly></td>    </td></tr>    <tr><td align="center">      <input type="reset" class="convert" value="Clear All Fields" id="aaa">    </td>  </tr></table></form><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->