HTML + JS + CSS courseQ16. Adding an Alert


#1

Hi team,

I’m having trouble figuring out what I’m missing here. I’m up to Question 16: On the Radio.
The error message I keep getting is "Opps, try again. Did you add a alert that displays tempType.
When I check the convert button, the pop up works but I’m not sure what to do next.

Have I used the alert element correctly? Also, is it in the correct code sequence?


#2

There is a chance that tempType is undefined if it does not get set in the loop.

The variable is somewhat ambiguous as it implies a type, some particular data type. Is this variable intended to refer to a scale such as Celsius or Fahrenheit or Kelvin?

Also, please post a link to the exercise so we can test your code.


#3

Thank you for your response. Here is a link to the exercise: https://www.codecademy.com/en/courses/html-javascript-css/2/4#

And a better screenshot for a bit more context:


#4

When you enter a value and click Convert does an alert pop up? If the SCT is examining the code directly, it may not expect a space…

alert(tempType);

Belay my comments about the variable name. Looks like the author chose that name…


#5

(Face palm)… You’re absolutely right. No space needed.
As you can probably tell I’m new to JS and this also happens to be my first ever coding forum post.
Thank you very much for your help! Much appreciated.