Ejemplos en Javascript

Celsius - Fahrenheit

Conversor

<HTML>
<HEAD>

<TITLE>Ejemplos Javascript: ejemplo pr???¡ctico </TITLE>



</HEAD>

<BODY bgcolor="white">

<center>
<SCRIPT LANGUAGE="JavaScript">
function celtofar (form)
{form.fahrenheit.value = form.celsius.value*1.8+32}
function fartocel (form)
{ form.celsi.value = (form.fahren.value-32)/1.8 }
</SCRIPT>
<FORM>
<INPUT TYPE ="text" NAME="celsius" SIZE=15 >
<INPUT TYPE ="button" VALUE="Celsius -> Fahrenheit" ONCLICK="celtofar(this.form)">
<INPUT TYPE="text" NAME="fahrenheit" SIZE=15 >
<p>
</form>
<form>
<input type ="text" NAME="fahren" SIZE=15 >
<input type = "button" value="Fahrenheit -> Celsius" onClick="fartocel(this.form)">
<input type="text" NAME="celsi" SIZE=15 >
</FORM>
</center>

</body>
</html>

Conversores