10 lines
283 B
JavaScript
10 lines
283 B
JavaScript
// ---------- Toggle ---------------------------------------
|
|
export class Toggle {
|
|
|
|
static password(elem) {
|
|
elem.addEventListener('click', () => {
|
|
const input = elem.previousElementSibling;
|
|
input.type = input.type === 'password' ? 'text' : 'password';
|
|
});
|
|
}
|
|
} |