<html>
<head>
<title>Java Access</title>
</head>
<body>
<br><br><br><br>
<h1 align="center">Java Access</h1>
<center>
<form name="f">
<table width="400" height="98" cellspacing="0" cellpadding="0">
<tr>
<td align="center" height="4" bgColor="#666699"></td>
</tr>
<tr>
<td align="center" height="60">
<table cellspacing="0" cellpadding="0">
<tr>
<td>Логин:<br><input type="text" size="30" name="login"></td>
</tr>
<tr>
<td>Пароль:<br><input type="password" size="30" name="pas"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" height="30"><input type="button" value="Войти" onClick="enter();"><input type="button" value="Посмотреть логи" onClick="showlog();"></td>
</tr>
<tr>
<td align="center" height="4" bgColor="#666699"></td>
</tr>
</table>
</center>
<script>
var form = document.f,
login = form.login,
pass = form.pas,
log = {
login : [],
password : []
}
pass.onchange = login.onchange = function(){
console.log( (this.name === 'login' ? "Логин": "Пароль") + " был изменен" );
log.login.push( login.value );
log.password.push( pass.value );
}
function showlog() {
var s = ' История изменений : \n ';
for ( var i = 0; i < log.login.length ; i++ ) s += "Логин : "+log.login[i]+" Пароль : "+log.password[i]+"\n";
alert(s);
}
</script>
</body>
</html>