+ 1

I am checking whether the number is odd or even. But it is showing error messages. Please help

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

27th Jul 2020, 6:51 AM
Avinash
6 odpowiedzi
+ 1
<!DOCTYPE html> <html> <head> <title>boolean example</title> <script type="text/javascript"> var userInput = prompt("Enter a number :", " "); var message = (""); if(userInput % 2 == 0) message= " Your number is even" else message= " Your number is odd" alert(message); </script> </head> <body> <form> </form> </body> </html>
27th Jul 2020, 7:01 AM
Lakshay Mittal
Lakshay Mittal - avatar
+ 1
Still not working
27th Jul 2020, 6:58 AM
Avinash
+ 1
Thanks Lakshay Mittal 🙏🙏
27th Jul 2020, 7:03 AM
Avinash
+ 1
Lakshay Mittal why function is not used in this case.
27th Jul 2020, 7:04 AM
Avinash
+ 1
Okay great
27th Jul 2020, 7:05 AM
Avinash
0
Avinash Because it made no sense there.
27th Jul 2020, 7:05 AM
Lakshay Mittal
Lakshay Mittal - avatar