Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <style type="text/css">
- #username
- {
- position:absolute;
- margin-top:20px;
- margin-left:20px;
- }
- #pwdummy, #passwd
- {
- position:absolute;
- margin-top:50px;
- margin-left:20px;
- }
- </style>
- </head>
- <body>
- <form id="javascriptform" method="POST" style="display:none;">
- <input
- type="text"
- id="username"
- value="username"
- width="100px"
- onblur="if (this.value == '') {
- this.value = 'username';
- }"
- onfocus="if (this.value == 'username') {
- this.value='';
- }"
- />
- <input
- type="text"
- id="pwdummy"
- value="password"
- style="width:100px;"
- onfocus="document.getElementById('passwd').style.display='';
- document.getElementById('passwd').focus();"
- />
- <input
- type="password"
- id="passwd"
- style="display:none;width:100px;"
- onfocus="document.getElementById('pwdummy').style.display='none';"
- onblur="if (document.getElementById('passwd').value == '') {
- document.getElementById('pwdummy').style.display='';
- this.style.display='none';}"
- />
- </form>
- <form id="plainhtmlform" method="POST" style="display:block;" >
- <p>Username: <input type="text"></p>
- <p>Password: <input type="password"></p>
- </form>
- <script type="text/javascript">
- document.getElementById('javascriptform').style.display='block';
- document.getElementById('plainhtmlform').style.display='none';
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement