前两天刚有发问过这个问题啊,你可以查查看
没什么太好的办法,用document.all遍历可以实现,因为每个元素都有一个soureIndex的我要把有限的生命投入到无限的为人民回贴事业中去!谁会申请域名?帮我申请一个,最好是www.meixx.com/net/org,不要二级和三级的!
还有好的免费空间,谁知道?帮忙啊!
没什么太好的办法,用document.all遍历可以实现,因为每个元素都有一个soureIndex的我要把有限的生命投入到无限的为人民回贴事业中去!谁会申请域名?帮我申请一个,最好是www.meixx.com/net/org,不要二级和三级的!
还有好的免费空间,谁知道?帮忙啊!
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
<title>Untitled Document</title>
<script language="javascript">
var x=0;
var y=0;
var lastrownum=0;
var lastcellnum=0;
document.onkeydown =function moveSel(){
var e = window.event;
var code=e.keyCode;
//ascii left 37 right 39 up 38 down 40
if(code==37 || code==39) moveY(code-38);
else if(code==38 || code==40) moveX(code-39);
else return;
}
function moveX(step){
tb.rows[x].cells[y].style.backgroundColor="#FFFFFF";
if(step==-1 && x==0) x=lastcellnum;
else if(step==1 && x==lastcellnum) x=0;
else x=x+step;
SelectCell();
}
function moveY(step){
tb.rows[x].cells[y].style.backgroundColor="#FFFFFF";
if(step==-1 && y==0) y=lastrownum;
else if(step==1 && y==lastrownum) y=0;
else y=y+step;
SelectCell();
}
function SelectCell(){
tb.rows[x].cells[y].style.backgroundColor="#cccccc";
tb.rows[x].cells[y].children[0].focus();
}
function init(){
lastrownum=tb.rows.length-1;
lastcellnum=tb.rows[0].cells.length-1;
tb.rows[x].cells[y].style.backgroundColor='#cccccc';
tb.rows[x].cells[y].children[0].focus();
}
</script>
</head><body onLoad="init()">
<table id="tb" name="tb" width="400" height="" border="1" cellspacing="0" cellpadding="0" style="border-collapse:collapse " bordercolor="#111111">
<tr>
<td width="10%"><input type="text" name="textfield"></td>
<td width="10%"><input type="text" name="textfield"></td>
<td width="10%"><input type="text" name="textfield"></td>
<td width="10%"><input type="text" name="textfield"></td>
</tr>
<tr>
<td><input type="text" name="textfield"></td>
<td><input type="text" name="textfield"></td>
<td><input type="text" name="textfield"></td>
<td><input type="text" name="textfield"></td>
</tr>
<tr>
<td><input type="text" name="textfield"></td>
<td><input type="text" name="textfield"></td>
<td><input type="text" name="textfield"></td>
<td><input type="text" name="textfield"></td>
</tr>
<tr>
<td><input type="text" name="textfield"></td>
<td><input type="text" name="textfield"></td>
<td><input type="text" name="textfield"></td>
<td><input type="text" name="textfield"></td>
</tr>
</table></body>
</html>我要把有限的生命投入到无限的为人民回贴事业中去!谁会申请域名?帮我申请一个,最好是www.meixx.com/net/org,不要二级和三级的!
还有好的免费空间,谁知道?帮忙啊!