In a form, I have a text input with a datalist. In the datalist, I have accented terms that won't appear in my text input. For example : If I type "a", terms with "ä" or "à" won't appear in suggestion...
The best would be the whole to be accent insensitive
Does anyone encounter that problem already ?
Thank you
The datalist tag is introduced in HTML5. The <datalist> tag should be used with an <input< element that contains a "list" attribute. The value of "list" attribute is linked with the datalist id.
HTML5 <datalist> elements cannot be styled.
Like select elements, the datalist element has very little flexibility in styling. You cannot style any of the suggested terms if that's what your question was asking. Browsers define their own styles for these elements.
The <datalist> tag is used to provide an "autocomplete" feature for <input> elements. Users will see a drop-down list of pre-defined options as they input data.
One dirty way you can do this is by doing something likes this:
var noAccent = str.normalize( "NFD" ).replace( /[\u0300-\u036f]/g, "" );
if (str !== str) {// Add a duplicate entry without the accent}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With