I would like to have my code return the HTML input using an alert.
I tried to with this code, below, but the output was nothing. I am pretty sure that its not the button...
<center>
<h3>Enter The Username And Password To Unlock This Computer</h3>
<script>
function incorrect() {
var user = document.getElementById("username");
var pass = document.getElementById("password");
text = "the username '" + user + "' is incorrect, and the password '" + pass + "' is also incorrect"
console.log(text)
alert(text)
}
</script>
<form>
<h6>Username</h6><input type="text" id="username" name="username" value="">
<h6>Password</h6><input type="text" id="password" name="password" value="">
<br><button type="button" onclick="incorrect">Unlock</button>
</form>
</center>
onclick="incorrect"toonclick="incorrect()"<center>tag is deprecated for more than 10 years, it's use is not advisable and it can stop working at any time