Please help me with the code, it does work on my editor | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Please help me with the code, it does work on my editor

https://code.sololearn.com/W9vjZxEL1rAe/?ref=app

26th Jul 2020, 11:11 AM
Pe Tex
Pe Tex - avatar
8 Answers
26th Jul 2020, 1:30 PM
Nova
Nova - avatar
+ 11
1. Enclose your JS code inside the Calc function. The code does not run as the function is not found. 2. Parenthesis are not closed for parseInt for variables a and b. 3. You forgot to add # to querySelector while assigning the result value from calculate to result div.
26th Jul 2020, 11:18 AM
Nova
Nova - avatar
+ 11
Peter You are calling a function Calc() on button click, but there isn't any function in your code. So you need to define that function like this: function Calc() { // add your code from JS tab }
26th Jul 2020, 12:17 PM
Nova
Nova - avatar
+ 3
Nova Thanks alot
26th Jul 2020, 2:06 PM
Pe Tex
Pe Tex - avatar
+ 2
Nova Thanks for 2 and 3 But I don't understand the enclosure your referring to
26th Jul 2020, 12:09 PM
Pe Tex
Pe Tex - avatar
+ 2
Ipang Thanks
26th Jul 2020, 12:09 PM
Pe Tex
Pe Tex - avatar
+ 1
Nova Please is there any way u can do it and link it to me🙏 Cus its not still working
26th Jul 2020, 1:15 PM
Pe Tex
Pe Tex - avatar