电脑技术学习

用javascript在textarea中禁用输入法

dn001

在CSS中style="ime-mode:disabled"可以禁用输入法,用脚本控制:obj.style.imeMode = 'disabled';

例子:

<input name="number" value="" style="ime-mode:disabled" />

document.onfocus = function(){document.body.style.imeMode = 'disabled'};