Advertisement
Guest User

Untitled

a guest
May 7th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.45 KB | None | 0 0
  1. <html>
  2. <head>
  3. <style type="text/css">
  4. #username
  5.         {
  6.             position:absolute;
  7.             margin-top:20px;
  8.             margin-left:20px;
  9.         }
  10.        
  11. #pwdummy, #passwd
  12.         {
  13.             position:absolute;
  14.             margin-top:50px;
  15.             margin-left:20px;
  16.         }
  17. </style>
  18.    
  19. </head>
  20. <body>
  21.     <form id="javascriptform" method="POST" style="display:none;">
  22.     <input
  23.         type="text"
  24.         id="username"
  25.         value="username"
  26.         width="100px"
  27.         onblur="if (this.value == '') {
  28.                      this.value = 'username';
  29.                 }"
  30.         onfocus="if (this.value == 'username') {
  31.                      this.value='';
  32.                 }"
  33.     />
  34.     <input
  35.         type="text"
  36.         id="pwdummy"
  37.         value="password"
  38.         style="width:100px;"
  39.         onfocus="document.getElementById('passwd').style.display='';
  40.                  document.getElementById('passwd').focus();"
  41.     />
  42.     <input
  43.         type="password"
  44.         id="passwd"
  45.         style="display:none;width:100px;"
  46.         onfocus="document.getElementById('pwdummy').style.display='none';"
  47.         onblur="if (document.getElementById('passwd').value == '') {
  48.                     document.getElementById('pwdummy').style.display='';
  49.                     this.style.display='none';}"
  50.     />
  51.     </form>
  52.     <form id="plainhtmlform" method="POST" style="display:block;" >
  53.         <p>Username: <input type="text"></p>
  54.         <p>Password: <input type="password"></p>
  55.     </form>
  56.     <script type="text/javascript">
  57.         document.getElementById('javascriptform').style.display='block';
  58.         document.getElementById('plainhtmlform').style.display='none';
  59.     </script>
  60. </body>
  61. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement