I have a select dropdown and certain number of options in that.
I want to change color of options whenever i hover in and out of the option.
Like :- when i hover on a option the color should turn to red and when i hover out i should be transparent again.
it is not working proper.
JS
$("select").hover(function (e){
var $target = $(e.target);
if($target.is('option')){
$target.css('background-color', 'red');
}
});
HTML
<select class="select1" size="8" >
<option>Ajwa Finance Ltd. </option>
<option>Ajwa Fun World & Resort Ltd. </option>
<option>Akar Tools Ltd.</option>
<option>Akasaka Electronics Ltd.</option>
<option>Akash Agencies Ltd.</option>
<option>Akash Agro Inds. Ltd.</option>
</select>
Please help me with this
Thanks