How can I hide the password entered by a user in a dialog prompt in JavaScript? For example, using something like
var passwd = prompt(\"Enter Password : \",
As of many answers you can't mask the input with a JavaScript prompt() but some alternative way to done this functionality using custom solution or use password input box instead.
jQuery UI - Dialog Modal Form
Use a modal dialog to require that the user enter data during a multi-step process. Embed form markup in the content area, set the modal option to true, and specify primary and secondary user actions with the buttons option.
Ref : Dialog Modal Form
jQuery Impromptu plugin
Using html option you write html tags.
Ref : Impromptu Plugin
Using JavaScript
Only by opening a little window containing a password form field:
Ref : irt.org