js 设置 输入法 状态

来源:互联网 发布:linux收发邮件 编辑:程序博客网 时间:2024/04/29 22:50

js实现焦点进入文本框内关闭输入法

要用到的东西: imeMode:xxx

有四个参数

active 代表输入法为中文
inactive 代表输入法为英文
auto 代表打开输入法 (默认)
disable 代表关闭输入法

<INPUT onfocus=" this.style.imeMode='active' " />

<INPUT onfocus=" this.style.imeMode='inactive' " />

<INPUT onfocus=" this.style.imeMode='auto' " />

<INPUT onfocus=" this.style.imeMode='disabled' " /> 这个应该算最常用的了。