0

I get the box but when I put value it shows error in line 8

<html> <head> <title>Javascript</title> </head> <body> <script type="text/javascript"> var Varper=Number(prompt("Enter%")); if (per>=70) {document.write("Distinction");} elseif(per>=60) {alert("First Class");} elseif(per>=50) {document.write("Second Class");} elseif(per>=35) {document.write("Pass Class");} elseif(per>35) {document.write("Fail Class");} </script> </body> </html>

19th Jan 2017, 1:45 PM
AshKing
AshKing - avatar
4 ответов
+ 8
replace "elseif" with "else if"
19th Jan 2017, 1:56 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 1
U created variable "Varper" but used per, try writing per only at its place. And second it's "if else" not ifelse. Hope it solves ur problem.
19th Jan 2017, 1:48 PM
Divesh Agarwal
Divesh Agarwal - avatar
+ 1
thanks
19th Jan 2017, 1:57 PM
AshKing
AshKing - avatar
+ 1
Yes ok
19th Jan 2017, 1:59 PM
AshKing
AshKing - avatar