Whats differents between datalist and select? | SoloLearn: Learn to code for FREE!

+6

Whats differents between datalist and select?

3/29/2017 3:26:17 PM

shaldem

1 Answer

New Answer

+10

Think of it as the difference between a requirement and a suggestion. For the select element,theuser is required to select one of the options you've given. For the datalist element, it is suggested that the user select one of the options you've given, but he can actually enter anything he wants in the input. So which one you use depends upon your requirements. If the user must enter one of your choices, use the select element. If the use can enter whatever, use the datalist element.