Create pop up with user password as dialog - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window prompt

Description

Create pop up with user password as dialog

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/* w  w w . j a  va 2 s .c  om*/
var username = window.prompt("Enter your username","");
var password = window.prompt("Enter your password","");
document.getElementById("ID").innerHTML = username + " " + password;
    }

      </script> 
   </head> 
   <body> 
      <a id="ID"></a>  
   </body>
</html>

Related Tutorials