Hey I want to show datalist of specific input on click of button but I cannot find how to.
HTML
<input type="text" name="" value="" list="list" id='input'>
<datalist id='list'>
<option value="aaa">
<option value="bb">
</datalist>
<div onclick="showDataList(event,'input')">
Click
</div>
JS
function showDataList(e,id) {
document.getElementById(id).list.show()
}
I have tried double focus(), focus() and click() and checking on which event datalist show function fires but to no avail.