js切换光标示例代码

时间:2013-10-10    点击:411   
复制代码 代码如下:

<!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>
<title>js切换光标</title>
<script type="text/javascript">
var t;
function a()
{
document.getElementById('input1').focus();
t=setTimeout("b()",3000);
//clearTimeout(t);
//document.getElementById('input2').focus();
//document.getElementById('input1').focus();
}
function b()
{
clearTimeout(t);
document.getElementById('input2').focus();
}
function c()
{
setTimeout("document.getElementById('input3').focus()",500);
}
</script>
</head>
<body>
<input id="testButton" type="button" onclick="a()" value='btn1'>
<input type="text" id="input1">
<input type="text" id="input2">

<input id="testButton1" type="button" onclick="c()" value='btn2'>
<input type="text" id="input3">
</body>
</html>

光标停留一段时间,跳到别一个方本框中去……
JavaScript 垃圾回收机制分析
js导出table数据到excel即导出为EXCEL文档的方法
Jquery attr("checked") 返回checked或undefined 获取选中失效
Javascript Web Slider 焦点图示例源码
JS实现程序暂停与继续功能代码解读
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved