1

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.

0

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

jQuery(document).ready(function(){
  var content = jQuery('input:text').attr('placeholder');
  jQuery('input:text').attr('placeholder',content+'*');
});

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.