I want to add css class dropdownliststyle to dropdown only when "please select" is selected on focus.how do i do that?
here is my jsfiddle link https://jsfiddle.net/3dj3srxp/ to that
CSS
.DropDownStyle {
background-color: red;
color: white;
}
jquery
$(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');
});
});