Example 1open_soft_keyboard ({input: "#username"});//Example 2open_soft_keyboard ({input: ' input[value= ""} ");/** * Open soft keyboard by default * @param options{* Input: ' #nickname '//Container node *} * @author cai Boom * @version 1.0.3 build 20151226 */function Open_soft_ke Yboard (Options) {if (Plus.os.name = = ' IOS ') {setTimeout (function () {var wv_current = Plus.webview.curr Entwebview (). Nativeinstanceobject (); Wv_current.pluscallmethod ({"Setkeyboarddisplayrequiresuseraction": false}); Document.queryselector (options[' input '). focus (); }, 330); }else{//Because Android autofocus is only supported in the 4.0 version, the native.js is used to force pop-up setTimeout (function () {///when executing, you need to make the current web View gain focus var wv_current = Plus.android.currentWebview (); Plus.android.importClass (wv_current); Wv_current.requestfocus (); var Context = Plus.android.importClass ("Android.content.Context"); var Inputmethodmanager = Plus.android.importClass ("android.view.iNputmethod. Inputmethodmanager "); var main = plus.android.runtimeMainActivity (); var imm = Main.getsystemservice (Context.input_method_service); Imm.togglesoftinput (0,inputmethodmanager.show_forced); Document.queryselector (options[' input '). focus (); }, 330); }}
Open page Default popup soft keyboard, compatible with both iOS and Android