×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Web Designer
Added: Feb 17, 2016 2:10 PM
Views: 13
Tags: length limit text
Ograniczenie ilości wpisywanych znaków
  1.  
  2. /* Ograniczenie ilości wpisywanych znaków */
  3. if ( $( '.max-chars' ).length ) {
  4.     $( '.max-chars' ).keyup( function () {
  5.         var max = $( this ).prop( 'maxlength' );
  6.         var current = $( this ).val().length;
  7.         var val = max - current;
  8.         $( '.val' ).text( val );
  9.     } );
  10. }