Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
Why this switch isn't giving any output?

I've been trying a while to solve this out for my schoolproject, but somehow i can't get this done.

What i' trying to do is to get a temperature from user and by using switch to give a feedback. So fr nothing comes out.

<!DOCTYPE html>
<html>
<body>
<h1>Lämpötilan arvio</h1>
<p>Syötä kesäpäivän lämpötila ja klikkaa arvioi.</p>
<form>

<label for="temperature">Lämpötila:</label>
<input type="text" id="temperature"><br>

<input type="button" value="Arvioi" onclick="evaluate()"><br>
<p id="result">Ulkona on</p>
</form>
<script>
  function evaluate(){
  var temperature = document.getElementById("temperature").value;
  var result = ""
  switch (temperature) {
  case (Number(temperature) < 11):
    result = "KYLMÄÄ";
    break;
  case (Number(temperature) < 16):
    result = "KOLEAA";
    break;
  case (Number(temperature) < 21):
    result = "MELKO LÄMMINTÄ";
    break;
  case (Number(temperature) < 26):
    result = "LÄMMINTÄ";
    break;
  case (Number(temperature) < 31):
    result = "HELLETTÄ";
}
  document.getElementById("result").innerHTML = result;
}
</script>
</body>
</html>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!