如何在文本框焦点上显示键盘 [英] How to display a keyboard on textbox focus
本文介绍了如何在文本框焦点上显示键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个项目,我想在元素的焦点上自动弹出键盘。
我已将touchstart事件绑定到元素。该元素正在聚焦,但键盘没有弹出。
我事件试图延迟。但仍然没有运气。
这是我试过的代码。
Hi,
I have a project where I want to automatically popup the keyboard on the focus of the element.
I have bind the touchstart event to the element. The element is getting focussed but the keyboard is not popping up.
I event tried putting a delay. But still no luck.
This is the code which I tried.
$("#id").bind('touchstart', function(e) {
$("#id").focus();
});
$('#id').trigger("touchstart");
任何帮助将不胜感激。
Any help would be appreciated.
推荐答案
( #id ).bind(' touchstart', function (e){
("#id").bind('touchstart', function(e) {
( #id) .focus();
});
("#id").focus(); });
(' # id')。触发器( touchstart);
('#id').trigger("touchstart");
任何帮助都将不胜感激。
Any help would be appreciated.
这篇关于如何在文本框焦点上显示键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文