Write a JavaScript function that will check the temperature according to the following criteria: The function should be called when click on submit button (onSubmit) • If the temperature field is empty, then display an alert "please enter a temperature • If the temperature is greater than 50 then display an alert "the weather is hot" If the temperature is less than 15 then display an alert "the weather is cold" If the temperature is greater than 15 and less than 40 then display an alert "the weather is nice

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 12PE
icon
Related questions
Question
Enter a Temprature Value I
Temprature
submit
Write a JavaScript function that will cheek the temperature according to the following criteria:
The function should be called when click on submit button (onSubmit)
If the temperature field is empty, then display an alert please enter a temperature"
If the temperature is greater than 50 then display an alert "the weather is hot"
• If the temperature is less than 15 then display an alert "the weather is cold"
If the temperature is greater than 15 and less than 40 then display an alert "the weather is nice
Attach File
Browse My Computer
Transcribed Image Text:Enter a Temprature Value I Temprature submit Write a JavaScript function that will cheek the temperature according to the following criteria: The function should be called when click on submit button (onSubmit) If the temperature field is empty, then display an alert please enter a temperature" If the temperature is greater than 50 then display an alert "the weather is hot" • If the temperature is less than 15 then display an alert "the weather is cold" If the temperature is greater than 15 and less than 40 then display an alert "the weather is nice Attach File Browse My Computer
Expert Solution
steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Knowledge Booster
Introduction to Coding
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage