Skip to content

themahabbat/maxlengthJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

maxlengthJS

Javascript maxlength validator

preview

Installation

Include jQuery

Include maxlength.css and maxlength.js

Usage

Give jQuery element selector to new Maxlength instance

<script type="text/javascript">
// for all inputs
new Maxlength('input');

// for text type inputs
new Maxlength('input[type=text]');

// for inputs which have maxlength attribute
new Maxlength('input[maxlength]');

// for specific input
new Maxlength('#inputId');
</script>

Customization

You can write your own css code inside --maxlength class to change look