Friday, 8 September 2017

How To Create a Temperature Converter With Example

How To Create a Temperature Converter With Example

Code , code for Temperature Converter, Temperature Converter with Example , website code , How to use Temperature Converter.

Example :
 
<!DOCTYPE html>
<html>
<title>Fahrenheit to Celcius Temperature Converter</title>
<body>

<h2>Temperature Converter</h2>
<p>Type a value in the Fahrenheit field to convert the value to Celcius:</p>

<p>
  <label>Fahrenheit</label>
  <input id="inputFahrenheit" type="number" placeholder="Fahrenheit" oninput="temperatureConverter(this.value)" onchange="temperatureConverter(this.value)">
</p>
<p>Celcius: <span id="outputCelcius"></span></p>

<script>
function temperatureConverter(valNum) {
  valNum = parseFloat(valNum);
  document.getElementById("outputCelcius").innerHTML=(valNum-32)/1.8;
}
</script>
</body>
</html>

Post a Comment

Whatsapp Button works on Mobile Device only

Start typing and press Enter to search