Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <!-- 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. -->
- <html>
- <body>
- <script type="text/javascript">
- var uname=prompt('Enter a username: ');
- var pass
- while(pass!='password')
- {
- pass=prompt('Enter a password: ');
- }
- document.write('<a href="hi.html" onclick="alert(\'' + uname+ ', you are entering into fantasy!\')">Click</a>');
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement