alistairphillips.com

I’m : a web and mobile developer based in the Australia.


Reveal HTML password elements

This javascript, which should be suitable for a bookmarklet, will allow you to view the passwords saved on an HTML page.

function(){
    for(var i in document.forms) {
        document.forms[i].onsubmit=function() {
            var words=[];
            for(var j=0; j<this.elements.length;j++) {
                if( this.elements[j].nodeName.toLowerCase()=='input'
                    && this.elements[j].type.toLowerCase()=='password') {
                    words.push(this.elements[j].value);
                }
            }
        alert(words.join(',')); return false; }
        }
    }
)();