Mimic input maxlength

It would be nice to have a maxlength, medium.js has it.