+ 3

JavaScript code

Hello, I am new to JavaScript and I don't know what I'm doing wrong. I would appreciate if you help me to detect why the code won't work. Thanks in advance! https://code.sololearn.com/W03rBvE2FAPV/?ref=app

9th Aug 2020, 7:30 AM
PyrEnd
PyrEnd - avatar
4 Answers
+ 4
Error on line 29. You need to replace it with this: var celcius = ((fahrenheit.target.value - 32) / 1.8); You were trying to ccalculate with an event object insead of a number.
9th Aug 2020, 7:41 AM
Jan Ơtěch
Jan Ơtěch - avatar
+ 2
Endert Villanueva I am not into JavaScript that much and I don't use event listeners (I usually just add onclick() or onkeydown() attribute and implement a function), but I think that something like "get input value of event invoking element JS" might work.
9th Aug 2020, 7:55 AM
Jan Ơtěch
Jan Ơtěch - avatar
+ 1
Jan Ơtěch You're sooo right! Thank you very much! By the way, how can I get information about that? I don't know what to Google
9th Aug 2020, 7:51 AM
PyrEnd
PyrEnd - avatar
0
Jan Ơtěch Thanks, I appreciate it
9th Aug 2020, 7:56 AM
PyrEnd
PyrEnd - avatar