A Pen by Captain Anonymous on CodePen.
Created
March 4, 2014 12:47
-
-
Save anonymous/9345845 to your computer and use it in GitHub Desktop.
A Pen by Secret Sam.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="input_container"> | |
<input type="text" id="1234" maxlength="18" /> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("input").keyup(function(){ | |
if($(this).val().length>=18){ | |
$('#1234').addClass('lololo'); | |
}else{ | |
$("#1234").removeClass('lololo'); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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