$(document).ready(function() {                        
    $('#inputId').bind('input propertychange',function(){
      var len=getByteLen($(this).val());
      var width = Number(len)*8;
      if(width<100){    //100:初始设置的输入框长度
        $(this).css('width','100px');
      }else{
        $(this).css('width',width+'px');
      }
    });     
  })
  function getByteLen(val) {
       var len = 0;
       for (var i = 0; i < val.length; i++) {
          var strVal=val.charAt(i);
      //len所取数值,根据页面字体大小设置  并非死值
      if(/[^\x00-\xff]/g.test(strVal)){
        len += 1.8;//汉字
      }else if(/^[0-9]+$/.test(strVal) || /^[a-zA-Z]+$/.test(strVal)){
        len += 0.98;//数字 或 字母
      }else{
        len += 0.6;//处理特殊字符
      }
    }
    return len;
  }