Skip to content

Instantly share code, notes, and snippets.

Created Feb 24, 2017
What would you like to do?
Basis for Temp Converter - HMTL and JavaScript
<p>Temp: <br />
<input type="text" id="tempInput" /><br />
<input id="radioCT" type="radio" name="conversionType" value="CToF" checked>Celsius to Fahrenheit</input><br />
<input id="radioCT" type="radio" name="conversionType" value="FToC">Fahrenheit to Celsius</input><br />
<button onclick="convertTemp()">Convert</button>
<p id="output">&nbsp;</p>
function convertTemp()
alert("in function");
var t = document.getElementById("tempInput").value;
var convertCtoF = document.getElementById("radioCT").checked;
document.getElementById("output").innerHTML = "convert c to f";
document.getElementById("output").innerHTML = "convert f to c";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment