我想获取此值并检查现有用户密码:
const Users =[{
userName: 'Hasan1934',
password: 'Qwx32dksa'
}]
和输入值:const UserName = document.getElementById("username-field")
const Password = document.getElementById("password-field")
和条件:
for (let index = 0; index < Users.length; index++) {
let ArrayItem = Users[index];
if (UserName === ArrayItem.userName && Password === arrayItem.password ) {
// console.log("your in !!!!!!!!!!!**********");
break;}}
它对我来说不起作用const UserNameHtml = (document.getElementById("username-field") as HTMLInputElement).value
1条答案
按热度按时间2g32fytz1#
试试这个