简体   繁体   English

我们如何使用phonegap或javascript打开iPhone / android本机键盘

[英]How can we open iPhone/android native keyboard using phonegap or javascript

In my Phonegap application i need one div which is scrollable, When user click on it device keyboard should be open and text should be writeable in div. 在我的Phonegap应用程序中,我需要一个可滚动的div,当用户单击它时,设备键盘应处于打开状态,文本应可在div中写入。 But i dont know how to open device native keyboard for both device. 但是我不知道如何为两个设备打开设备本机键盘。 Is there any plugin available for this functionality. 是否有任何插件可用于此功能。

Have a hidden input field, and onclick event of that div, simply call focus() for that input field. 有一个隐藏的输入字段,以及该div的onclick事件,只需为该输入字段调用focus()即可。 It'll automatically bring up the keyboard. 它会自动调出键盘。 And then you can read the content of the input field and write that into the div. 然后,您可以读取输入字段的内容并将其写入div。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM