jquery.restrictFieldLength.js

  • 1.参考资料

http://www.cnblogs.com/aarond/archive/2013/08/02/3234042.html

  • 2.使用举例

 //字符控制
    $(function () {
        $(".lengthLimit20").restrictFieldLength({
            maxTextLength: 20,
            restoreTime: 2000//,
            //exceptionCallback: processException
        });
        $(".lengthLimit25").restrictFieldLength({
            maxTextLength: 25,
            restoreTime: 2000//,
            //exceptionCallback: processException
        });
        $(".lengthLimit30").restrictFieldLength({
            maxTextLength: 30,
            restoreTime: 2000//,
            //exceptionCallback: processException
        });
        $(".lengthLimit35").restrictFieldLength({
            maxTextLength: 35,
            restoreTime: 2000//,
            //exceptionCallback: processException
        });
        $(".lengthLimit50").restrictFieldLength({
            maxTextLength: 50,
            restoreTime: 2000//,
            //exceptionCallback: processException
        });
    });
原文地址:https://www.cnblogs.com/jacketlin/p/6252086.html