简体   繁体   中英

Show all options of datalist on focus

Is there any way to show all options of datalist on focus? I need to show all the options even after a key press.

<form action="" method="get">
 <input list="browsers" name="browser">
 <datalist id="browsers">
  <option value="Internet Explorer">
  <option value="Firefox">
  <option value="Chrome">
  <option value="Opera">
  <option value="Safari">
 </datalist>
 <input type="submit">
</form>

FIDDLE

PS: This is not same as this question. My datalist options are generated dynamically using jquery.

$('input').on('click', function() {
  $(this).val('');
});

try this this will work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM