Phiên bản đầy đủ: jsB@nk » Tính toán » Tương đương » Biến đổi đơn vị chiều dài 2
URL: https://www.javascriptbank.com/convert-measures-customary-length.html
Một đoạn mã khác để biến đổi đơn vị chiều dài.
Phiên bản đầy đủ: jsB@nk » Tính toán » Tương đương » Biến đổi đơn vị chiều dài 2
URL: https://www.javascriptbank.com/convert-measures-customary-length.html
<script language="javascript">function cliner(){a=document.cline.mi.value;b=document.cline.yd.value;c=document.cline.ft.value;d=document.cline.inc.value;if(a != ""){//document.cline.mi.value=a/.1;document.cline.yd.value=a*1760;document.cline.ft.value=a*1760*3;document.cline.inc.value=a*1760*3*12;}if(b != ""){document.cline.mi.value=b/1760;//document.cline.yd.value=b/.1;document.cline.ft.value=b*3;document.cline.inc.value=b*3*12;}if(c != ""){document.cline.mi.value=c/3/1760;document.cline.yd.value=c/3;//document.cline.ft.value=c/.1;document.cline.inc.value=c*12;}if(d != ""){document.cline.mi.value=d/12/3/1760;document.cline.yd.value=d/12/3;document.cline.ft.value=d/12;//document.cline.inc.value=d/.1;}}</script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<form name="cline"><table width="50%" border="1" cellspacing="0" cellpadding="0"><tbody><tr><td colspan="2" bgcolor="#c8f2bf"><font size="+2"><center>Convert <i>within</i> the Customary System - Length</center></font><b><center><font size="+1">Enter your measure in the appropriate box and click on the <i>calculate</i> button to see the comparisons:</font></center></b></td></tr><tr><td align="center" width="60%"><b>Miles</b></td><td align="center" bgcolor="#bed7d8"><input type="text" name="mi" size="16" value=""></td></tr><tr><td align="center"><b>Yards</b></td><td align="center" bgcolor="#bed7d8"><input type="text" name="yd" size="16" value=""></td></tr><tr><td align="center"><b>Feet</b></td><td align="center" bgcolor="#bed7d8"><input type="text" name="ft" size="16" value=""></td></tr><tr><td align="center"><b>Inches </b></td><td align="center" bgcolor="#bed7d8"><input type="text" name="inc" size="16" value=""></td></tr><tr><td align="center" colspan="2" bgcolor="#c8f2bf"><input type="button" onclick="cliner()" value="Calculate"> <input type="reset" value="Reset"><div align="right"> <font size="-2">© Jeff LeMieux, 2002</font> </div></td></tr></tbody></table></form><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->