0

I have to make some list attributes. I found an example on w3schools, that actually shows exact like the code I want. I can see that it is not supported in Safari and IE9 and down. Is there any script you can put in my code, so I can use this code, or what do I have to use if my datalist has to be supported by all browsers?

<input list="browsers">

<datalist id="browsers">
  <option value="Internet Explorer">
  <option value="Firefox">
  <option value="Chrome">
  <option value="Opera">
  <option value="Safari">
</datalist>
Julie24
  • 279
  • 4
  • 6
  • 19

2 Answers2

1

It seems that you don't need users to type anything, so why not to use a simple select element?

The select element is supported by all browsers and it is really similar to use. Below is an example:

<select>
  <option value="ie">Internet Explorer</option>
  <option value="firefox">Firefox</option>
  <option value="chrome">Chrome</option>
  <option value="opera">Opera</option>
  <option value="safari">Safari</option>
</select>

If you need more information you can see it here: http://www.w3schools.com/tags/tag_select.asp

If you want to know the difference between the select and the datalist you can read this: HTML Form: Select-Option vs Datalist-Option

Community
  • 1
  • 1
joalcego
  • 1,098
  • 12
  • 17
0

I used bootstrap framework for it instead.

Julie24
  • 279
  • 4
  • 6
  • 19