mirror of https://github.com/aredn/aredn.git
17 lines
431 B
Plaintext
17 lines
431 B
Plaintext
|
<script>
|
||
|
(function(){
|
||
|
function toggle()
|
||
|
{
|
||
|
const p = htmx.findAll("input.password-toggle");
|
||
|
const t = p[0].type === "text" ? "password" : "text";
|
||
|
for (let i = 0; i < p.length; i++) {
|
||
|
p[i].type = t;
|
||
|
}
|
||
|
}
|
||
|
const b = htmx.findAll("input.password-toggle + button.icon.eye");
|
||
|
for (let i = 0; i < b.length; i++) {
|
||
|
htmx.on(b[i], "click", toggle);
|
||
|
}
|
||
|
})();
|
||
|
</script>
|