开发者

min and max jQuery character counter

开发者 https://www.devze.com 2023-03-08 10:01 出处:网络
There are many max cha开发者_JAVA百科racter counters in jQuery. Has anyone found any useful min character counters?

There are many max cha开发者_JAVA百科racter counters in jQuery.

Has anyone found any useful min character counters?

I'm looking for something like what StackOverflow uses when creating a comment:

min and max jQuery character counter


This should work:

var min = 15;
$("#idOfTextbox").keydown(function() {
    if(this.value.length < min) {
        // Min notice
    } else {
        // Current count
    }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号