Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. (function () {
  2.  
  3. var limite = 10;
  4.  
  5. function limitaInput(input) {
  6. if (input.value.length > limite) {
  7. input.value = input.value.substr(0, limite);
  8. }
  9. }
  10.  
  11. $(document).on("propertychange change keyup", ".loading", function () {
  12. if (this.timerLimitInput) {
  13. clearTimeout(this.timer);
  14. }
  15.  
  16. this.timerLimitInput = setTimeout(limitaInput, 10, this);//Timeout para evitar conflitos
  17. });
  18.  
  19. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement