CSS中input属性强制小写字母转大写

text-transform    ------------------  uppercase
 
 
$("#autType").on("input",inputLimitsHandle);
    function inputLimitsHandle(){   //只能输入数字和大写字母
        if($("#autType").attr("placeholder") == "请输入公司社会信用统一代码"){
            $("#autType").attr("maxlength","18").css("text-transform","uppercase");
            var that = $(this);
            if(that.val() != ""){
                that.removeClass("required");
            }else{
                that.addClass("required");
            };
            
            that.val(that.val().replace(/[W]/g,''));
            if(that.val().length > 18){
                that.val(that.val().slice(0,18));
            };
        }else if($("#autType").attr("placeholder") == "请输入营业执照号"){
            $("#autType").attr("maxlength","15");      //只能输入数字
            var that = $(this);
            if(that.val().length > 15){
                that.val(that.val().slice(0,15));
            };
            that.val(that.val().replace(/[^d]/g,''));
        }
    };
原文地址:https://www.cnblogs.com/swt-axios/p/12841965.html