<html>
<head>
<script language="javascript">
var recordList= new Array();
function add(){
var b =document.all.b.value;
var d = document.all.d.value;
var s = document.all.s.value;
recordList.push(new Array(b,s,d));
}
function setValue(){
for(var i=0;i<recordList.length;i++){
if (recordList[i][0]==document.all.b.value){
document.all.s.value = recordList[i][1];
document.all.d.value = recordList[i][2];
};
}
}
</script>
</head>
<body>
<input name="b" onkeyup="setValue()"><input name="s"><input name="d" onkeyup="add()"><input type="button" value="记录" onclick="add()">
</body>
</html>
<head>
<script language="javascript">
var recordList= new Array();
function add(){
var b =document.all.b.value;
var d = document.all.d.value;
var s = document.all.s.value;
recordList.push(new Array(b,s,d));
}
function setValue(){
for(var i=0;i<recordList.length;i++){
if (recordList[i][0]==document.all.b.value){
document.all.s.value = recordList[i][1];
document.all.d.value = recordList[i][2];
};
}
}
</script>
</head>
<body>
<input name="b" onkeyup="setValue()"><input name="s"><input name="d" onkeyup="add()"><input type="button" value="记录" onclick="add()">
</body>
</html>
<input type="button" value="记录" onclick="add()">
<input type="button" value="记录" onclick="add()">
<HEAD>
<TITLE> New Document </TITLE>
</HEAD><BODY>
b:<input id="b" onchange="inputB()"/><br/>
s:<input id="s" onchange="inputS()"/><br/>
d:<input id="d" onchange="inputD()"/><br/><script language="javascript">
var bArray = new Array();
var sArray = new Array();
var dArray = new Array();function inputB() {
if (bArray[b.value] == undefined) {
bArray[b.value] = b.value;
} else {
s.value = sArray[b.value];
d.value = dArray[b.value];
}
}function inputS() {
sArray[b.value] = s.value;
}function inputD() {
dArray[b.value] = d.value;
}
</script></BODY>
</HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD><BODY>
b:<input id="b" onpropertychange="inputB()"/><br/>
s:<input id="s" onpropertychange="inputS()"/><br/>
d:<input id="d" onpropertychange="inputD()"/><br/><script language="javascript">
var bArray = new Array();
var sArray = new Array();
var dArray = new Array();function inputB() {
if (bArray[b.value] == undefined) {
bArray[b.value] = b.value;
} else {
s.value = sArray[b.value];
d.value = dArray[b.value];
}
}function inputS() {
sArray[b.value] = s.value;
}function inputD() {
dArray[b.value] = d.value;
}
</script></BODY>
</HTML>
<head>
<script language="javascript">
var recordList= new Array();
function add(){
var b =document.all.b.value;
var d = document.all.d.value;
var s = document.all.s.value;
var i;
for(i=0;i<recordList.length;i++){
if (recordList[i][0]==document.all.b.value){//若存在重复键,修改原来的键值
recordList[i][1]=document.all.s.value;
recordList[i][2]=document.all.d.value;
break;
}
}
if (i==recordList.length)recordList.push(new Array(b,s,d)); //若没找到重复键,新建记录
}function setValue(){
for(var i=0;i<recordList.length;i++){
if (recordList[i][0]==document.all.b.value){
document.all.s.value = recordList[i][1];
document.all.d.value = recordList[i][2];
break;
}
}
}
</script>
</head>
<body>
<input name="b" onpropertychange="setValue()"><input name="s" onpropertychange="add()"><input name="d" onpropertychange="add()">
</body>
</html>