Last active
August 16, 2017 17:16
-
-
Save hozefaj/b9df41c6d2ea57357dbd9c5641aa784f to your computer and use it in GitHub Desktop.
JS code to show passwords field values when filling forms
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 characters
// change passwords fields into text on a web page | |
const nodeList = document.getElementsByTagName("input"); | |
[...nodeList].forEach(node => { | |
if(node.getAttribute("type") === "password"){ | |
node.setAttribute('type', 'text'); | |
} | |
}); | |
// wrap code within github to multiple lines | |
// this helps to prevent horizontal scroll | |
[...document.querySelectorAll('code')].map(code => code.setAttribute('style', 'white-space: pre-wrap')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment