Skip to content

Instantly share code, notes, and snippets.

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