<script>
    functioncheckLength(which) {

       var maxChars = 30; //
       if(which.value.length > maxChars){
          alert("您输入的字数超多限制!");
           //超过限制的字数了就将 文本框中的内容按规定的字数 截取
          which.value = which.value.substring(0,maxChars);
           returnfalse;
       }else{
           var curr =maxChars - which.value.length; //250 减去 当前输入的
          document.getElementById_x_x_x_x_x("sy").innerHTML =curr.toString();
           returntrue;
       }
    }
</script>

效果图

字数限制

 

相关文章:

  • 2021-12-15
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2021-12-15
猜你喜欢
  • 2021-12-15
  • 2021-12-15
  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
  • 2021-12-15
相关资源
相似解决方案