limitCharacts

Limits and trim the amount of characters added to any input/textarea tag. 0.8kb (minified)

Use


var elem = document.querySelectorAll('input'),
    limit = 100;
limitCharacts(elem,limit);