13

I am using HTML and trying to make list as shown in the image before. However, by using datalist I can't get a scroll bar. Can you please tell me how can I enable scroll bar in datalist. (Note: can't use scripting language in my website to achieve this).

<input list="browsers" name="browser">
<datalist id="browsers">
  <option value="Afghanistan">
  <option value="Aland Islands">
  <option value="Albania">
  <option value="Algeria">
  <option value="American Samoa">
  //Many more countries
  .
  .
  .
  <option value="Zcountry">
</datalist>

enter image description here

Stephan Muller
  • 27,018
  • 16
  • 85
  • 126
D P.
  • 1,039
  • 7
  • 27
  • 56

1 Answers1

-8

How abbout this ?

 <label for="country">Country:</label>
    <input type="text" id="country" list="country_list">
    <datalist id="country_list">
      <option value="AF">Afghanistan</option>
      <option value="AX">Åland Islands</option>
      <option value="AL">Albania</option>
      <option value="DZ">Algeria</option>
      <!-- more -->
    </datalist>
trai bui
  • 588
  • 12
  • 36
  • How is that any different from what the OP already has? (OK, you’ve added a `label`, but I don’t suppose that’ll fix the issue?) – CBroe Jul 24 '14 at 10:12