title: How to add class to dropdownlist using jquery depending on option
body: <p>I want to add css class dropdownliststyle to dropdown only when "please select" is selected on focus.how do i do that?</p>
  
  <p>here is my jsfiddle link <a href="https://jsfiddle.net/3dj3srxp/" rel="nofollow">https://jsfiddle.net/3dj3srxp/</a> to that</p>
  
  <p>CSS</p>
  
  <pre><code> .DropDownStyle {
     background-color: red;
     color: white;
   }
  </code></pre>
  
  <p>jquery</p>
  
  <pre><code>$(document).ready(function() {
      $('input[type="text"]').each(function() {
        $(this).focus(function() {
          $(this).addClass('textBoxStyle');
        });
  
        $(this).blur(function() {
          $(this).removeClass('textBoxStyle');
        });
      });
  
      $('select').focus(function() {
          $(this).addClass('DropDownStyle');
      });
  
      $('select').blur(function() {
          $(this).removeClass('DropDownStyle');
        });
  
    });
  </code></pre>