$('input').each(function(){
if($(this).is('[required=required]')){
if ($(this).is('[noAsterisk]')){
return null;
} else {
$(this).closest(".YourClassName").children("label").append('<font style="color:red;position:absolute;" > *</font>');
}
}
});
* javascript above require jQuerywith the code:
if ($(this).is('[noAsterisk]')){allow you to add exception with 'noAsterisk', where you don't require asterisk as there had 'required' html tag appended.
return null;
}