Created
September 29, 2017 10:12
-
-
Save kovtunos/9caa580fd1f2de803871c587e7735d29 to your computer and use it in GitHub Desktop.
Add class to selected form #jquery #form
This file contains hidden or 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
// Add class to Selected form | |
$('select').on('change', function() { | |
if ($(this).val()) { | |
return $(this).addClass('is-selected'); | |
} else { | |
return $(this).removeClass('is-selected'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment