鼠标在网页加载成功后自动移到一个指定的区域 鼠标在网页加载成功后自动移到一个指定的区域,有JavaScript怎么实现,哪位大哥帮助小弟下。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 额 能具体点吗 我对JavaScript不太熟悉 你指的是焦点吗,比如一个输入框,就像百度一样,打开页面后,鼠标定位到搜索栏中如果是用jquery的话,jquery自行准备,这个就不给你发了,呵呵<!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 src="jquery-1.4.2.min.js"></script><script>$(function(){ $("#abc").focus(); });</script></head><body><input id="abc" type="text" /></body></html>同时这个方法也适用于其他元素<!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 src="jquery-1.4.2.min.js"></script><script>$(function(){ $("#ee").focus(); });</script><style type="text/css"><!--#dd { height: 800px; margin-bottom: 10px; border: 1px solid #000;}#ee { border: 1px solid #F00; height: 200px;}--></style></head><body><input id="abc" type="text" /><div id="dd">这里是DD</div><div id="ee">这里是EE</div></body></html> 这个一般input标签比较明显比如<!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=utf-8" /><title>5_14</title><script>function test(){ document.getElementById("textbox1").focus();}</script></head><body onload="test()"><input type="text" id="textbox1" /><input type="text" id="textbox2" /></body></html> 为什么还能提交 求助JavaScript提交表单同时传递多个变量 怎样用javascript访问文件夹下的图片 请教修改一段代码 请问知道在javascript中如何获得指定路径下的文件名?可以模糊查找的。 请教firefox下如何取得上传图片的fileSize ? split问题 a.htm中有个iframe,src=b.htm,我可以在刷新a.htm时不刷新b.htm码? 怎么实现所见既所得,如DREAMWEAVER的编辑网页的功能? 如何动态的把复选框中选定的值赋给表单中另一个对话框域?? 点击获取<li>的值 1
<!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 src="jquery-1.4.2.min.js"></script>
<script>
$(function(){
$("#abc").focus();
});
</script></head><body>
<input id="abc" type="text" /></body>
</html>同时这个方法也适用于其他元素<!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 src="jquery-1.4.2.min.js"></script>
<script>
$(function(){
$("#ee").focus();
});
</script>
<style type="text/css">
<!--
#dd {
height: 800px;
margin-bottom: 10px;
border: 1px solid #000;
}
#ee {
border: 1px solid #F00;
height: 200px;
}
-->
</style>
</head><body>
<input id="abc" type="text" />
<div id="dd">这里是DD</div>
<div id="ee">这里是EE</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>5_14</title>
<script>
function test(){
document.getElementById("textbox1").focus();
}
</script>
</head><body onload="test()">
<input type="text" id="textbox1" />
<input type="text" id="textbox2" />
</body>
</html>