1
I can show in Alert but qnd I will put in text (temp2), will not!
function mostrarValor(){
var escalaEntrada = getRadioValor('escalaEntrada');
var escalaSaida = getRadioValor('escalaSaida');
var valor = parseInt(document.getElementById("temp1").value);
if (escalaEntrada === "celsius" && escalaSaida === "kelvin") {
resul = (valor + 273);
window.alert(resul);
/*var saida = document.getElementById("temp2");
saida.innerHTML = resultado;*/
}
}
Make sure the HTML element
#temp2
exists? can also publish the relevant HTML in the question sff– Miguel
@Miguel, yes it exists, I created it: <input id="temp2" class="temp" type="text"/>
– paloma
Haa. I get it, it’s a little misunderstanding. The input (self closing tag) doesn’t take with
text
, what you want to do is modify the value. Do so:document.getElementById("temp2").value = resul;
– Miguel
That’s why it’s important to publish everything relevant and can help solve the problem :P
– Miguel
@Miguel Nossa, thanks. Thank you so much! And sorry, I’m new here rsrs.
– paloma
No problem. I’m glad you solved
– Miguel