SHARE
TWEET

Untitled

a guest Dec 9th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="nl">
  3. <head>
  4.  
  5.     <meta http-equiv="Content-type"
  6.         content="text/html; charset=UTF-8">
  7.     <title>lab 09</title>
  8. </head>
  9. <body>
  10.         <script>
  11.  
  12.             var text;
  13.             var rol = prompt("wat is je rol?");
  14.            
  15.             switch(rol) {
  16.                
  17.             //admin case//
  18.             case "admin":
  19.                 var actualPassword = "admin";
  20.                 var attemptedPassword = prompt("Please enter the password");
  21.  
  22.                 if(attemptedPassword == actualPassword) {
  23.                
  24.                 document.write('Welkom Admin');
  25.                 } else {
  26.                  
  27.                 alert("Code ongeldig.");
  28.                 }
  29.             break;
  30.    
  31.             //student case//
  32.             case "student":
  33.                 var actualPassword = "student";
  34.                 var attemptedPassword = prompt("Please enter the password");
  35.  
  36.                 if(attemptedPassword == actualPassword) {
  37.                 document.write('Welkom Student');
  38.                 } else {
  39.                 alert("Code ongeldig.");
  40.                 }
  41.             break;
  42.  
  43.             //default case//
  44.             case "default":
  45.                 alert("Rol ongeldig.");
  46.             break;
  47.             }
  48.  
  49.            
  50.         </script>
  51. </body>
  52. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top