Well, you should set the maxLength attribute using jQuery, for example, as follows:
$('#myBox').attr('maxlength', 6);
There is additional information in this question .
But with your question, it's hard to say what you tried. Please add the jQuery code you tried to solve, so we can help you.
Marijn
source share