<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title> 无标题文档 </title>
<script type="text/javascript">
function myclick()
{
alert("随便去做一些事情");
var mybutton=event.srcElement;
mybutton.focus();
}
function aaa(){
alert(this.id);
if(event.keyCode==39){
button3.focus();
}
if(event.keyCode==37){
button1.focus();
}
}
</script>
</head> <body>
<input id="button1" type="button" value="button1" onkeydown="aaa(this)" />
<input id="button2" type="button" value="button2" onclick="myclick();" onkeydown="aaa(this)"/>
<input id="button3" type="button" value="button3" onkeydown="aaa(this)" />
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title> 无标题文档 </title>
<script type="text/javascript">
function myclick()
{
alert("随便去做一些事情");
var mybutton=event.srcElement;
mybutton.focus();
}
function aaa(){
alert(this.id);
if(event.keyCode==39){
button3.focus();
}
if(event.keyCode==37){
button1.focus();
}
}
</script>
</head> <body>
<input id="button1" type="button" value="button1" onkeydown="aaa(this)" />
<input id="button2" type="button" value="button2" onclick="myclick();" onkeydown="aaa(this)"/>
<input id="button3" type="button" value="button3" onkeydown="aaa(this)" />
</body>
</html>
<head>
<title>U</title>
<script type="text/javascript">
function myclick()
{
alert("随便去做一些事情");
var mybutton=event.srcElement;
mybutton.focus();
} function aaa(){
var nMaxID = 3;
var mybutton=event.srcElement;
var btnid = mybutton.id;
var nID = parseInt(btnid.substring("button".length)) if(event.keyCode==39){
nID++;
}
if(event.keyCode==37){
nID--;
}
if (nID>nMaxID)
nID = 1; if (nID<1)
nID = nMaxID;
document.getElementById("button"+nID).focus();
}
</script>
</head> <body>
<input id="button1" type="button" value="button1" onclick="myclick();" onkeydown="aaa()" />
<input id="button2" type="button" value="button2" onclick="myclick();" onkeydown="aaa()"/>
<input id="button3" type="button" value="button3" onclick="myclick();" onkeydown="aaa()" />
</body>
</html>