Created
August 19, 2013 10:52
-
-
Save micronax/6267906 to your computer and use it in GitHub Desktop.
Small jQuery hack to decorate input fields with required="required" attribute with an (red) asterisk
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
/** Decorate required fields **/ | |
$('input[required="required"]').each(function(){ | |
$(this).prev('label').after(' <span class="required">*</span>'); | |
}); |
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
span.required { | |
color:darkred; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment