Created
August 28, 2016 10:25
-
-
Save adamgavlak/20caf2243c5d8a1301894477e85d54c9 to your computer and use it in GitHub Desktop.
Simple script for revealing password
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let password_field = document.querySelector("#user_password") | |
let password_revealer = document.querySelector("#user_password_revealer") | |
password_revealer.addEventListener("click", function(e) { | |
if (password_revealer.checked) { | |
password_field.type = "text" | |
} else { | |
password_field.type = "password" | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment