It is using span with custom style which sets the text’s foreground color/colour to black to hide it (as by default, this site uses the black background color/colour), answer can be seen if you select all (cmd/ctrl+A) while on web-page.
Here is my automated JavaScript solution for Main Level 2.
By saying “automated”, I mean when you execute the following JavaScript script I wrote, it will display username and password to your screen.
It will autofill user and pass elements/fields with appropriate values, and automatically submit the form for you as you run the code :)
<3 XPath.
Run the following JavaScript code from JavaScript console in your web-browser while on web-page:
```function getElementByXPath(xpath)
{
return document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
}
var username = String(getElementByXPath(“//[@id=\"main-content\”]/div/div[2]/div[2]/form/fieldset/span[1]“).innerText);
var password = String(getElementByXPath(”//[@id=\“main-content\”]/div/div[2]/div[2]/form/fieldset/span[2]“).innerText);
document.getElementById("user”).value = username;
document.getElementById(“pass”).value = password;
console.log(username);
console.log(password);
alert(“Username: ” + username + “\nPassword: ” + password);
document.getElementsByTagName(“input”)[3].click();```
P.S. I love JavaScript.
Greetings from OmegaExtern.