<input type="text" name="" placeholder="nd"><span hidden="hidden" id = "hi" style="color: red">*</span>
<script>
jQuery(document).ready(function(){
var c = $("#hi").text();
$(c).css('color','red');
var content = jQuery('input:text').attr('placeholder');
jQuery('input:text').attr('placeholder',content+c);
});
</script>
I have placed input text with a placeholder and using jquery script I am trying to add * immediately after the placeholder's text which should have red color but my code is not working. The asterisk mark is showing in the placeholder but it is of color black not of red.