Advertisement
viditkothari

Assignment6

Sep 15th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.78 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <!-- Assignment #6: Write a javascript in which you make the user enter the username & password with the word password & give appropriate message to display a hyperlink. As the user clicks on the hyperlink, display the message “You are entering in the world of fantasies”. Once the password is correct then only he is able to see otherwise not. -->
  3. <html>
  4.     <body>
  5.         <script type="text/javascript">
  6.             var uname=prompt('Enter a username: ');
  7.             var pass
  8.             while(pass!='password')
  9.                 {
  10.                     pass=prompt('Enter a password: ');
  11.                 }
  12.             document.write('<a href="hi.html" onclick="alert(\'' + uname+ ', you are entering into fantasy!\')">Click</a>');
  13.         </script>
  14.     </body>
  15. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement