- <input name="zc_code" id="zc_code" type="text" value="" class="zc_code" maxlength="15"/>
-
- <script>
- function get_shurufa(){
- $('#zc_code').on('input', function() {
- if ($(this).prop('comStart')) return; //中文输入过程中不截断
- console.log('当前输入:' + $(this).val());
- }).on('compositionstart', function(){
- $(this).prop('comStart', true);
- console.log('中文输入:开始->' + $(this).val());
- }).on('compositionend', function(){
- $(this).prop('comStart', false);
- console.log('中文输入:结束->' + $(this).val());
- });
- }
- $(document).ready(function(){
- get_shurufa()
- });
- </script>
以上就是JQ判断输入法的详细内容,更多关于JQ判断输入法的资料请关注九品源码其它相关文章!