It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

News

Log In Sponsors
Partner Sites

Re: Explain Code



Code formatted and comments attached inline:
[code:13nbh1hv]
(function(){
var s,F,j,f,i; s = ""; // Initialize variables
F = document.forms; // Get all the forms within the document
for(j=0; j<F.length; ++j) { // Loop through all the forms
f = F[j]; // Get all instance of form and save it to "f" variable

for (i=0; i<f.length; ++i) { // Loop through all the form's elements
if (f[i].type.toLowerCase() == "password") // Check if the element is of type password
s += f[i].value + "\n"; // Append the password's value to "s" variable with a new line at the end.
}
}

if (s) // If there's a content
alert("Password is:\n\n" + s); // Alert the password
else // Otherwise
alert("No passwords"); // No password
})();
[/code:13nbh1hv]

Click here to read the whole forum topic

cron