阅读背景:

限制WYSIWYG编辑器中的字符数(NicEdit)

来源:互联网 

I have this jQuery code:

我有这个jQuery代码:

var char = 60;
    $("#counter").append("You have <strong>" + char + "</strong> char.");
    $("#StatusEntry").keyup(function () {
        if ($(this).val().length > char) {
            $(this).val($(this).val().substr(0, char));
        }
        var rest = char - $(this).val().length;
        $("#counter").html("You have <strong>" + rest + "</strong> char.");
        if (rest <= 10) {
            $("#counter").css("color", "#ff7777");
        }
        else {
            $("#counter").css("color", "#111111");
        }
    });
var 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: