You are trying to access the text in the input element incorrectly. You should try:
var userName = document.getElementsByName('Username')[0].value;
var passWord = document.getElementsByName('Password')[0].value;
if(userName == "admin" && passWord == "welcome")
{
window.open('dashboard.html')
}
else {
alert("The username and password don not match.")
}
document.getElementsByName() returns a NodeList, so you have to access it by an index: document.getElementsByName('staff_counter')[0] (depending on how many of these you have). Refrence
You're referencing the first element in that NodeList of that name that is why its [0]