0

I have a dropdown using the code below and all I want to do is change the background color to red when hovering over a specific salutation. Can someone please help me?

<div id="prefix" class="inputRow">
    <span class="inputLabel">Prefix/Salutation</span> <select
        class="inputPrefix" id="prefixList" title="Prefix or Saluation"
        tabindex=3>
        <option selected>Select</option>
        <option value="Mr.">Mr.</option>
        <option value="Mrs.">Ms.</option>
        <option value="Dr.">Dr.</option>
        <option value="Mrs.">Mrs.</option>
        <option value="Miss">Miss</option>
    </select>
</div>

.inputPrefix {
    float: left;
    margin-right: 20px;
    margin-left: 20px;
    width: 75px;
    border: 1px solid #E6E6E6;
}
user3767997
  • 83
  • 3
  • 10
  • 1
    I don't think you can do that. Although you can try this: http://stackoverflow.com/questions/4599975/html-select-box-options-on-hover – Ani Aug 04 '14 at 15:20

1 Answers1

0

Using this approach I don't think so it is feasible. Whenever you apply style then it applies on complete control. So select is the control. For this approach you can create dropdown using css. Because in that case dropdown structure in html looks like this

<div>
<span/>
<span/>
<span/>
</div>

Like here value saved in different span or we can say in different control. For this approach, you can learn about telerik controls. Check for it on google I think telerik can help you out. We use it mostly in .net, mvc. It's study will definitely provide you a better approach for fulfilling your requirement. It helps you to understand the formation of dropdown using div and span.

Tanul
  • 354
  • 4
  • 20