jQuery限制字符字数的方法

    xiaoxiao2026-02-09  3

    $(document).ready(function(){$(“.div”).each(function(){var maxwidth=23;if($(this).text().length>maxwidth){$(this).text($(this).text().substring(0,maxwidth));$(this).html($(this).html()+’…’);}});});

    相关资源:Jquery 限制文本框录入长度(字符或字节)实例
    最新回复(0)