Created
November 2, 2016 23:26
-
-
Save royboy789/a0a3833fa0a7505ed63f9ae1b4ac56c2 to your computer and use it in GitHub Desktop.
toggle class if input has value
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-class').on('change', function(){ | |
if( $(this).val().length > 0 ) { | |
$(this).toggleClass('value'); | |
} else if($(this).val().length < 1 ) { | |
$(this).toggleClass('value'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment