0

I'll like to know how to set password, so when clicked the password would be visible.

JS

11th Dec 2023, 11:38 AM
Dani Clara
Dani Clara - avatar
2 Answers
+ 1
Thanks đŸ€—
11th Dec 2023, 12:06 PM
Dani Clara
Dani Clara - avatar
0
<body> <input id="pwd" type="password" /> <button id="show">show</button> <script> show.onclick=()=>{ pwd.type = pwd.type=="password"? "text":"password"; show.textContent = show.textContent=="show" ? "hide":"show"; } </script> </body>
11th Dec 2023, 12:04 PM
Bob_Li
Bob_Li - avatar