由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
BuildingWeb版 - how to set default activated input field?
相关主题
哪位高手知道可以用php调用ipad的摄像头进行在线拍照吗?请教关于multipart/form-data
error of create ASP.net project in Visual Studio 2013 (转载)adding a search link
请教: 如何跟据browser不同改变语句中size值Any Idea ?
I am confused看看我的form问题
cgi problem.why some character can not display correctly?请教:how to gather input information from several webpages?
why is it?Drupal配置基础问题
post problemgoogle search 代码是怎么样的呢?
a problem confused a long time!土问题: how to check which key is pressed
相关话题的讨论汇总
话题: activated话题: input话题: default话题: field话题: set
进入BuildingWeb版参与讨论
1 (共1页)
o*o
发帖数: 404
1
I have a search box in web page. How could I make it activated by default
as the page is loaded, so user can type in it directly?
b****u
发帖数: 1027
2
use javascript, txtName.focus(); in onload event of the html body
l*******9
发帖数: 177
3
最近在看jquery,发现干这些事情真是容易。。例如
给那个 input element 起个名字(id="MySearchBox"),
然后找个地方加上
$(document).ready(function(){
$("input#MySearchBox").focus();
});
这个 $(document).ready 就和 window.onload 差不多
不过可以多个共存而无需addEventListener,比直接用
window.onload方便多了。。。

【在 b****u 的大作中提到】
: use javascript, txtName.focus(); in onload event of the html body
o*o
发帖数: 404
4
thanks. It turned out that I need use setTimeout because it's a dialog info
popup window.

【在 b****u 的大作中提到】
: use javascript, txtName.focus(); in onload event of the html body
1 (共1页)
进入BuildingWeb版参与讨论
相关主题
土问题: how to check which key is pressedcgi problem.why some character can not display correctly?
哪位高手能不能写个“设计e-commerce 网站123”?why is it?
哪位大侠推荐一款比较好的post problem
如何用HTML/JSTL读取当前页面某control的valuea problem confused a long time!
哪位高手知道可以用php调用ipad的摄像头进行在线拍照吗?请教关于multipart/form-data
error of create ASP.net project in Visual Studio 2013 (转载)adding a search link
请教: 如何跟据browser不同改变语句中size值Any Idea ?
I am confused看看我的form问题
相关话题的讨论汇总
话题: activated话题: input话题: default话题: field话题: set