Created
October 13, 2016 19:24
-
-
Save AllThingsSmitty/452821395961a3800c077130b864fdbd to your computer and use it in GitHub Desktop.
Revisions
-
AllThingsSmitty revised this gist
Oct 13, 2016 . 1 changed file with 0 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +0,0 @@ -
AllThingsSmitty created this gist
Oct 13, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ <form> <input id="txtPassword" type="password" autocomplete="off" /> <span id="btnToggle" class="fa fa-eye"></span> </form> This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ function togglePassword() { let passwordInput = document.getElementById('txtPassword'); if (passwordInput.type === 'password') { passwordInput.type = 'text'; } else { passwordInput.type = 'password'; } } (function () { let toggle = document.getElementById('btnToggle'); toggle.addEventListener('click', togglePassword, false); })();