Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title></title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width">
- <style></style>
- </head>
- <body>
- <script>
- i=0;
- Array = ["India","china","japan","America","australia"];
- Country = prompt("Enter your country name ( LowerCase )");
- x = setInterval(Check,0);
- function Check(){
- Array = Array.map(function(x){ return x.toLowerCase(); })
- if(Country=='' ){
- location.reload();
- }else if(Array[i]==Country){
- alert("Your country is listed");
- clearInterval(x);
- }else{
- i++;
- if(i==Array.length){
- alert("Your country is not listed");
- }
- }
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement