input文本输入框前后去空格

     $("form input[type=text]").each(function () {

                        this.value=$.trim(this.value);


 $(document).ready(function (){//通用方法去输入框前后空格
        $("form").on("change",function () {
            $("form input[type=text]").each(function () {
                this.value=$.trim(this.value);
            });
        })
    });


                    });

你可能感兴趣的:(个人笔记)