title: How can I hide the password entered in a JavaScript dialog prompt with asterisk characters?
body: <p>How can I hide the password entered by a user in a dialog prompt in JavaScript? For example, using something like this:</p>
  
  <pre><code>function ConfirmIt()
  {
      var control4 = '&lt;%=HiddenDelete.ClientID%&gt;';
      if (document.getElementById(control4).value == "True")
      {
          var x = prompt('Enter your Password ')
          var control = '&lt;%=HiddenField2.ClientID%&gt;';
          if (x !== "") {
              document.getElementById(control).value = x;
          }
          else {
              document.getElementById(control).value = "0";
          }
      }
      else
      {
          alert("No Permission");
      }
  }
  </code></pre>
  
  <p>I would like that when e.g. <code>12345</code> is entered it appears like <code>*****</code> or <code>.....</code> in the dialogue box. After that I want to select the password in a hiddenfield. Can anyone suggest how I can do this or provide some example code?</p>