<
input
type
="text"
id
="ftext"
value
="textbox 1"
/
>
<
input
type
="button"
value
="下个文本框获得焦点"
onclick
="test()"
/
>
<
br
/
>
< input type ="radio" / > < br / >
< input type ="checkbox" / > < br / >
< input type ="text" value ="textbox 2" / >
< script language ="javascript" type ="text/javascript" > ...
function test()
...{
var fInput = document.getElementById("ftext");
fInput=fInput.nextSibling
for(;fInput.type!="text";fInput=fInput.nextSibling);
fInput.focus();
}
</ script >
< input type ="radio" / > < br / >
< input type ="checkbox" / > < br / >
< input type ="text" value ="textbox 2" / >
< script language ="javascript" type ="text/javascript" > ...
function test()
...{
var fInput = document.getElementById("ftext");
fInput=fInput.nextSibling
for(;fInput.type!="text";fInput=fInput.nextSibling);
fInput.focus();
}
</ script >