You are viewing limited content. For full access, please sign in.

Question

Question

Change placeholder text color

asked on July 31, 2015

I am using the jquery.mask.min.js library to mask input fields within forms and I'm able to use the masks and placeholders perfectly.  At this point, I'm looking for a way to manipulate the placeholder 'text' (_) to be more bold.  I'm not sure if I can reference this with CSS or if it has to be done within the javascript itself.  

JS code below:

$.getScript('http://serverurl/Forms/js/jquery.mask.min.js', function () 
	{ 
      $(".phone input").mask("(999) 999 - 9999", {placeholder:"(___) ___ - ____"});
      $(".zip input").mask("99999", {placeholder:"_____"});
    }); //End Field Mask

Picture of field:

0 0

Answer

SELECTED ANSWER
replied on July 31, 2015 Show version history

Try this CSS

::-webkit-input-placeholder { /* Chrome, Safari, Opera */
    color: red !important;
}

:-moz-placeholder { /* Firefox 18- */
   color: red;  
}

::-moz-placeholder {  /* Firefox 19+ */
   color: red;  
}

:-ms-input-placeholder {  /* IE */
   color: red;  
}

You can use other styling besides changing the color.

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.