How To Change Placeholder Color On Select Field

In this article, We learn about how to add placeholder color in the select field.

For that, we need to create one HTML

<form action="" method="POST" class="select-form">
  <label>Select Technology</label>
  <select class="select-box">
    <option value="">Select....</option>
    <option value="css">CSS</option>
    <option value="html">HTML</option>
    <option value="worpdress">WordPress</option>
    <option value="javascript">Javascript</option>

Add jquery for add and remove class.

Here I use the function because we need to use the same code multiple times.

Here is a small suggestion Please use the function if you need to use the same code multiple times.

jQuery( document ).ready( function($) {
    $( document ).on( 'change', '', function(){
    } );
} );

function select_placeholder() {
  jQuery( '' ).each( function(){
    var select_val = jQuery( this ).val();
    if( select_val != '' ) {
      jQuery( this ).removeClass( 'select-placeholder' );
    } else {
      jQuery( this ).addClass( 'select-placeholder' );
  } );

Add this CSS

.select-box {
  width: 100%;
    color: #000;
} {
    color: #f00;
.select-box option {
    color: #000;

You can change the selected color as per your requirement.

Here is an Output:

1 Comment

  1. Erik

    Great, this is the first of the kind what is working as a charm. Big thanks!


Submit a Comment

Your email address will not be published. Required fields are marked *


Select Categories