Skip to content

Instantly share code, notes, and snippets.

@ricardozea
Created March 8, 2019 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ricardozea/50d0a2b5473fd980a26956b665ad9c2c to your computer and use it in GitHub Desktop.
Save ricardozea/50d0a2b5473fd980a26956b665ad9c2c to your computer and use it in GitHub Desktop.
<label class="show-password"><input type="checkbox" onclick="showPass()">Show password</label>
//Show Password
function showPass() {
var pass = document.getElementById("password"); //Input field id
if (pass.type === "password") {
pass.type = "text";
} else {
pass.type = "password";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment