Last active
August 29, 2015 14:12
-
-
Save timelf123/49e17aeabc162f446b7b to your computer and use it in GitHub Desktop.
In all forms found on page, find password fields and alert contents
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
| (function(){ | |
| // number of forms | |
| fl = document.forms.length; | |
| for(var i = 0; i < fl; i++) { | |
| tform = document.forms[i]; | |
| sfl = tform.length; | |
| for(var j = 0; j < sfl; j++) { | |
| // check if type attribute is set | |
| if(typeof tform[j].type != "undefined") { | |
| // if so check if type password | |
| if(tform[j].type.toLowerCase() == "password") { | |
| alert('password: '+tform[j].value); | |
| } | |
| } | |
| } | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment