Skip to content

Instantly share code, notes, and snippets.

@timelf123
Last active August 29, 2015 14:12
Show Gist options
  • Select an option

  • Save timelf123/49e17aeabc162f446b7b to your computer and use it in GitHub Desktop.

Select an option

Save timelf123/49e17aeabc162f446b7b to your computer and use it in GitHub Desktop.
In all forms found on page, find password fields and alert contents
(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