如何专注于特定控件的设置 [英] how to focus set up in particular control
本文介绍了如何专注于特定控件的设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮帮我.
我的查询是
现在将光标放在特定控件上.当用户按下输入按钮时,光标应放在特定控件上
我突然在文本框中输入内容,我按Enter键,十字键应该在该文本框中.
Hi,
Please help me out.
my query is
now cruser on particular control.when user press the enter button cruser should be focus particular control
i am entering something in text box suddenly i press enter button the crusser should be on that text box
推荐答案
很抱歉,我无法理解您的查询
您能再详细点吗?
以便我为您提供帮助.
Sorry to say but i am unable to understand your query
Will you please elaborate a little more?
So that i try to help you.
试试看,
hi try this,
<input id="textbox" type="text" onkeypress="return myScript(event)" />
//Add control on which you want to focus,for example:
<input id="targetTxtBox" type="text"/>
//Javascript function:
function myScript(e) {
if (e.keyCode == 13) {
var tb = document.getElementById("targetTxtBox");
tb.focus();
return false;
}
}
嗨..
例如,您要在文本框上放置光标.
Nametxt.Focus();
在页面加载或任何其他事件上
Hi..
For example you want cursor on text box.
Nametxt.Focus();
on page load or any other event
这篇关于如何专注于特定控件的设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文