Created
November 23, 2016 05:23
-
-
Save chillbits-legacy/38e0568b6c2171dc16df231eb6b2c30a to your computer and use it in GitHub Desktop.
Detect & add class for your dropdown select element before & after chosen 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
function colorizeSelect(){ | |
if($(this).val() == "0") $(this).addClass("empty"); | |
else $(this).removeClass("empty") | |
} | |
$("select").on('change keyup', colorizeSelect).change(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment