0
<form>
    <input type="text" id="inputbox"></br>
    <input type="button" value="Convert" onclick="kelvinCelsius();">
    </form>

    <div id="answer"></div>

    <script>
        function kelvinCelsius(){
         var theanswer = inputbox.value + 237.15
         answer.innerHTML = theanswer
        }
    </script>

I input 3 into the form and instead of getting 240.15, I get 3237.15. How can I make it so it adds the two values instead of concatenating them?

jeffdawg
  • 19
  • 4

0 Answers0