Beginning JavaScript - displaying temperature value in Inner HTML

前端 未结 3 1003
迷失自我
迷失自我 2021-01-22 04:07

I am in a beginning JavaScript class and very new to programming. I am attempting to make a program that converts Celsius to Fahrenheit or Fahrenheit to Celsius depending on whi

3条回答
  •  难免孤独
    2021-01-22 04:40

    Setting the value is normally used for input/form elements. innerHTML is normally used for div, span, td and similar elements.

    degrees_computed is input so you basically replace

    $("degrees_computed").innerHTML =
    

    with

    $("degrees_computed").value = 
    

提交回复
热议问题