Simple Keypress counter.

How to use it

download :

KeypressCounter.js KeypressCounter.min.js

Now you just have to write the proper classes/ID's in you JS file.

      
  $(document).ready(function(){
var recep = $('.recep'), // Where the plugin will be efficient.
i = 0;
// Insert the plugin on the zone. recep.append('<div>You pressed <span id="res"></span> keys</div>');

$('body').keyup(function(e){
var res = $('#res'), // ID of the <span></span> on the plugin zone.
zone = $('textarea'); // The input/textarea that we will count the keypress if(e.keyCode == 8){
i--;
}
else {
i++;
}

// If the input/textarea is empty, reset the counter. if (!$.trim(zone.val())) {
res.empty().append(0);
i = 0
}
// If not empty, append the number of keypress (i) and add a specific class . else{
res.addClass('label label--blue').empty().append(i);
}
});
});