Stap 4: Temperatuur conversie.
Oorspronkelijke code:
[code]
< script type = "text/javascript" >
functie temp (formulier) {}
Form.Fahrenheit.Value = form.celsius.value*1.8+32;
}
< / script >
< formulier >
< div align = "center" >< centrum >< p >< input type = "tekstgrootte" = "15" name = "celsius" >< sterke > graden
Celsius < / strong >< input type = "button" value = ""onclick="temp(this.form)" = >< input
type = "tekstgrootte" = "15" name = "fahrenheit" >< sterke > graden Fahrenheit < / strong >< /p >
< / center >< / div >
< / form >
[/ code]
Mijn bijgewerkte code:
[code]
< html >
< head >
< / head >
< br >
< h2 > temperatuur conversie < / h2 >
(Geef een waarde op en druk vervolgens op de = voor de temperatuur die u wilt converteren)
< hr >
< br >
< script type = "text/javascript" >
functie temp (formulier) {}
Form.Fahrenheit.Value = form.celsius.value*1.8+32;
}
functioneren temp1 (formulier) {}
Form.celsius1.Value = (form.fahrenheit1.value-32)/1.8;
}
< / script >
< formulier >
< div align = "center" >< centrum >< p >< input type = "tekstgrootte" = "15" name = "celsius" >< sterke > graden
Celsius < / strong >< input type = "button" value = ""onclick="temp(this.form)" = >< input
type = "tekstgrootte" = "15" name = "fahrenheit" >< sterke > graden Fahrenheit < / strong >< /p >
< / center >< / div >
< / form >
< br >
< center >--- of---< / center >
< br >
< formulier >
< div align = "center" >< centrum >< p >< input type = "tekstgrootte" = "15" naam = "fahrenheit1" >< sterke > graden Fahrenheit < / strong >< input type = "button" value = ""onclick="temp1(this.form)" = >< input
type = "tekstgrootte" = "15" name = "celsius1" >< sterke > graden Celsius < / strong >< /p >< / center >< / div >
< / form >
< / body >
< / html >
[/ code]