Skip to content

Instantly share code, notes, and snippets.

Created March 4, 2014 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/9345845 to your computer and use it in GitHub Desktop.
Save anonymous/9345845 to your computer and use it in GitHub Desktop.
A Pen by Secret Sam.
<div class="input_container">
<input type="text" id="1234" maxlength="18" />
</div>
$("input").keyup(function(){
if($(this).val().length>=18){
$('#1234').addClass('lololo');
}else{
$("#1234").removeClass('lololo');
}
});
.input_container{
position:relative;
display: inline-block;
height:25px;
}
.lololo {color: gray;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment