0

I am trying to get the dropdown with select tag highlighted upon page load. I have multiple classes in select tag I tried applying focus to all of them but it did not work. Can anyone please have a look at it?

div.cs-select select:focus {
  outline: thin dotted;
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}
<div id="originalAmount_@differAmountId" class="divoriginalAmount">

  <select class="cs-select cs-skin-border billAccountAmount " data-label="@StringResource.Lbl_Pay " id="@Html.IdFor(m => Model.AmountOptionList)">
Serg Chernata
  • 12,280
  • 6
  • 32
  • 50
Prasanna
  • 79
  • 2
  • 11

1 Answers1

0

This is something you'd have to do with javascript.

document.getElementById("AmountOptionList").focus();
div.cs-select select:focus {
  outline: thin dotted;
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}
<div id="originalAmount_@differAmountId" class="divoriginalAmount">

  <select class="cs-select cs-skin-border billAccountAmount " data-label="@StringResource.Lbl_Pay " id="AmountOptionList">
    <option>Options</option>
  </select>

</div>
Serg Chernata
  • 12,280
  • 6
  • 32
  • 50
  • can you tell me how can I get the Id of Select element in javascript? $('#@Html.IdFor(m => Model.AmountOptionList)').focus(); is not working – Prasanna Sep 13 '18 at 20:41