I want to add an asterisk mark to placeholder of inputs. Something like this: enter image description here

<input type="text" name="your-name" placeholder="Naam">

I do not want to add the symbol directly in the placeholder.

Currently trying to add pleaceholder after css but that is not working.

input[type=text]::-webkit-input-placeholder:after {
   content: '*';
   color: red;

anyone can help me add an asterisk to the placeholder.


You could do this easily with jQuery Put the following code in footer.

  var content = jQuery('input:text').attr('placeholder');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.