如何在整个页面中实现,当焦点进入text控件的时候,将text中的文字全部选中? <input onfocus="this.select()"> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <script>function test(){if(event.srcElement.type=="text")event.srcElement.select()}document.onmousemove=document.onmouseclick=test</script><input value="Test"><input value="Test"><input value="Test"><input type=checkbox value="Test"> 可不可以不在text上作任何事情,只通过window或document的事件来处理? onmousemove?那对于用键盘对focus做的切换呢?还有用代码对focus做的切换呢?有没有类似于onbeforeeditfocus的事件? TAB切换实际上是 onfocus 事件 每个控件有个id,你用document.all("id")就可以控制了。 <input name=as value=sdfl><input name=you value=sdfl><input name=like value=sdfl><input type=button value=set onclick=set(document.all("who").value)>选中的几个<input name=who><script language=javascript>function set(i){ try{ var objs=document.all.tags("INPUT"); objs[i-1].select(); alert("第"+i+"被选中了吧") }catch(e){}}function window.onload(){ set(1);//窗口初始化时,选中第一个}function document.onclick(){ set(5);//单击窗口时,选中第四个}</script> <input name=as value=sdfl onmouseover=this.select()><input name=you value=sdfl onmouseover=this.select()><input name=like value=sdfl onmouseover=this.select()> 我并不知道当前到达哪一个控件,只希望当控件获得焦点时,自动为选中状态,包括password,有没有写在window上的方法? js调用webservice 关于焦点离开文本对齐方式的问题 js 能模糊查询码?不能,准确查询也行。 jQuery压缩版本的功能是不是跟完整版本一样 那位大哥给个flash网站的源码参考一下 如何动态生成area标签及coods属性? 突破限制IP访问的方法?难倒我了! javascript 如何获得datagrid里的dropdownlist选种的索引 我看别人写的htc的代码 有一句好难理解,请各位帮忙,看看什么意思 怎么动态改变某个Frame的背景图像? 小错误 怎么实现页面的到时自动提交功能?
function test()
{
if(event.srcElement.type=="text")
event.srcElement.select()
}
document.onmousemove=document.onmouseclick=test
</script>
<input value="Test"><input value="Test"><input value="Test"><input type=checkbox value="Test">
还有用代码对focus做的切换呢?
有没有类似于onbeforeeditfocus的事件?
<input name=you value=sdfl>
<input name=like value=sdfl>
<input type=button value=set onclick=set(document.all("who").value)>
选中的几个<input name=who>
<script language=javascript>
function set(i){
try{
var objs=document.all.tags("INPUT");
objs[i-1].select();
alert("第"+i+"被选中了吧")
}catch(e){}
}function window.onload(){
set(1);//窗口初始化时,选中第一个
}
function document.onclick(){
set(5);//单击窗口时,选中第四个
}
</script>
<input name=you value=sdfl onmouseover=this.select()>
<input name=like value=sdfl onmouseover=this.select()>
只希望当控件获得焦点时,自动为选中状态,
包括password,有没有写在window上的方法?