aredn/files/app/partial/password-ctrl.ut

17 lines
425 B
Plaintext
Raw Normal View History

<script>
(function(){
function toggle()
{
const p = htmx.findAll(".password-toggle input");
const t = p[0].type === "text" ? "password" : "text";
for (let i = 0; i < p.length; i++) {
p[i].type = t;
}
}
const b = htmx.findAll(".password-toggle button.icon.eye");
for (let i = 0; i < b.length; i++) {
htmx.on(b[i], "click", toggle);
}
})();
</script>