How to show or trigger the datalist options on clicking of its corresponding text box? I have a datalist with options say 10. In chrome,a dropdown icon is shown allowing the user to know it has a dropdown list. But in firefox,icon is not available.Hence,the user may not be aware that it is a dropdown and just a text box .So i want to show the datalist options on click of that text box. any help appreciated.
相关问题
- Views base64 encoded blob in HTML with PHP
- How to fix IE ClearType + jQuery opacity problem i
- jQuery add and remove delay
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
Perhaps a solution might be this (Fiddle)
First of all i removed the default arrow in chrome with input::-webkit-calendar-picker-indicator
in after element i set a small image in content property
to make the image clickable use pointer-events:none
This solution works on the latest versions of Chrome, firefox and IE
If this solution does not suit your needs, i apologize for making you lose time.
That is a browser built-in feature that can't be modified. Also
datalist
isn't supported by Safari in versions lower than 12.1 nor lower versions of IE10In order to accomplish this functionality use this polyfill: webshim. This will give feature support to Safari and IE- and convert the
datalist
into a regularul
list that you can then easily attach events to display/hide the list without loosing the autocomplete functionality.