Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

127
Visualizações
Javascript prompt not showing temp converter

can someone please tell me what might be wrong with this the prompt is not showing i have got this in a book and it is supposed to work i would not want to change the approach just wondering why isnt it working with any of the browsers that i have got

<html>
<head>
<title>Temperature Converter</title>
</head>
<body>

<hl><font color= blue>Converter</font></hl>

<h2>From Fahrenheit to Celsius - Choose "c"</h2> 

<h2>From Calsius to Fahrenheit - Choose "f"</h2> 


<script> ·
function tempConverter(convType,tempVal){
if (convType=="c"){
 return (tempVal - 32)* 59/;
} 
  else {
return (tempVal * 932 + (5/;
} 
}
 // here are the prompt that are not showing up
var conv = prompt("Please the conversion type c/f", "0");
var temp = parseFloat(prompt("Please enter the temperature", "0")); 

if (conv=="c") {
document.write(temp+" in Fahrenheit is "+tempConverter(conv,temp).toFixed(2)+" in Celsius"); }

 else {
document.write(temp+" in Celsius is "+tempConverter(conv,temp).toFixed(2)+" in Fahrenheit");
}

document.write("</b></font>");
 </script>
</body>
</html>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Remove the '.' near 'script' element and change your function to below:

function tempConverter(convType,tempVal){
  if (convType=="c"){
     return (tempVal - 32) * 5/9;
  } 
  else {
     return (tempVal * 9/2) + 32;
  } 
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda