0
I'll like to know how to set password, so when clicked the password would be visible.
JS
2 Answers
+ 1
Thanks đ€
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>