60 537
Assignments Done
Successfully Done
In April 2018

Answer to Question #47676 in AJAX | JavaScript | HTML | PHP for john

Question #47676
I am trying to get a temperature conversion caculator to work for me and I seem to be having a confusing problem. The html code below is what I'm needing to follow by.
<!DOCTYPE html>
<title>Temperature Converter</title>
<p>Enter a Temperature to Convert in the field below and select the starting scale.</p>
<input type="text" name="txtTemp" id="txtTemp" placeholder="Enter a Temperature" />
<br />
<br />
<input type="radio" id="radFahrenheit" name="radTemp" checked/>Fahrenheit to Celcius
<input type="radio" id="radCelcius" name="radTemp"/>Celcius to Fahrenheit
<button onclick="ConvertTemp();">Convert</button>

<div id="divResults"></div>
<script type="text/javascript" src="Week7.js"></script>

And with the javascript part I've gotten this so far also I'm not use to if and else statements yet.

function ConvertTemp(){
var radFahrenheit = parsefloat(document.getElementById('radFahrenheit').value);
var radCelcius = parsefloat(document.getElementById('radCelcius').value);
var txtTemp = document.getElementById('txtTemp');

radFahrenheit = (radCelcius * (9/5)) + 32;
}else if(radC.checked){
radCelcius = (radFahrenheit -32) * (5 / 9)
Expert's answer

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions