每当用户从自动填充列表中选择时,我都会尝试捕获事件。我已尝试在选项标签中放置onClick事件,但它永远不会触发。
以下是代码:
<input id="facility_tb" class="fac_tb" type="text" title="Facility"
placeholder="Facility" list="fac"
onChange="alert('Change has happened')" >
<datalist id='fac'><option value='Andrew' >
<option value='Ashley'>
<option value='Apple'>
</option>
</datalist>