What's Wrong With This Code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

What's Wrong With This Code?

I'm new to JS. Please Help Me By Solving This Code. CODE: <!DOCTYPE html> <html> <head> <title>Test</title> </head> <body> <script type="text/javascript"> var age = prompt("What Is Your Age?"); if (age>=18 && age<=115) { window.alert("Whoa ! You Are An Adult!"); } else if (age<=17 && age>=0) { window.alert("Ya Kiddy..."); } else { window.alert("What A Liar!"); } break; var gendar = prompt("What Is Your Gendar?"); if (gendar == Boy) { window.alert("You Are So Handsome!!!"); } else if (gendar == Girl) { window.alert("You Are So Beautiful!!!"); else { window.alert("You Will Die Single!"); } </script> </body> </html>

6th Jun 2020, 9:38 AM
Noob Programmer
Noob Programmer - avatar
2 Answers
+ 1
made by abir sheikh <!DOCTYPE html> <html> <head> <title>Test</title> </head> <body> <script type="text/javascript"> var age = prompt("What Is Your Age?"); if (age>=18 && age<=115) { window.alert("Whoa ! You Are An Adult!"); } else if (age<=17 && age>=0) { window.alert("Ya Kiddy..."); } else { window.alert("What A Liar!"); } var gendar = prompt("What Is Your Gendar?"); if (gendar == "Boy") { window.alert("You Are So Handsome!!!"); } else if (gendar == "Girl") { window.alert("You Are So Beautiful!!!");} else{ window.alert("You Will Die Single!"); } </script> </body> </html>
6th Jun 2020, 10:38 AM
ABHISHEK
ABHISHEK - avatar
0
Check it now
6th Jun 2020, 10:39 AM
ABHISHEK
ABHISHEK - avatar