function inpurLimit(a){
var maxLen = 20;
if(a.val().length> maxLen){
aval(a.val().substr(0, maxLen));
}
var stringLength=a.val().length;
if(stringLength<= maxLen){
a.next('div').first().text(maxLen-stringLength);
}
}
$("input").keydown(function() {
inpurLimit($(this))
});