Does anyone know how to use an array in html to compare the elements of the array without using php?
This is what i have tried:
<form/>
<script language="javascript">
function check(form) {
var users = new Array();
users[0] = "John";
users[1] = "Ricky";
users[2] = "Billy";
users[3] = "Sunny";
var pass = new Array();
pass[0] = "123456";
pass[1] = "password";
pass[2] = "light";
pass[3] = "nero";
for (int i = 0; i < users.length; i++)
{
if (users[i] == pass[i])
{
window.open('http://ntm023.x10.mx/slotgame.html');
}
else
{
window.alert("error in username or password");
}
}
I want to compare these two arrays without using php.