Skip to Content
NFSFU234FormValidation v3 is here — file upload validation, config-driven rules, and more.
v3 (current)togglePasswordVisibility

togglePasswordVisibility

Toggles a single password field between masked and visible, swapping an optional show/hide icon accordingly. Returns: any

ParameterTypeRequiredDefaultDescription
inputHTMLInputElementrequired-The password input to toggle.
showIcon`null \string \HTMLElement`optional
hideIcon`null \string \HTMLElement`optional
Usage
Example: Toggle Password Visibility
const passwordInputField = document.querySelector("input[type=password]"); const showIcon = '🙈'; const hideIcon = '👀'; nfsfu234FormValidation.togglePasswordVisibility(passwordInputField, showIcon, hideIcon);
Last updated on