<input></input> 在HTML5时候增加表单属性:" list ",即list属性后是自定义的数据列表,html代码如下:
<td>
<input class="market-classifiction" name='materialCodeAdd' placeholder="请输入物料代码或中文名.." type="text" list="dataListItem" style="width: 220px;" id="materialCode" change="searchMaterialCode"/>
<datalist id="dataListItem">
<!--<option></option>-->
</datalist>
</td>
js中即操作dataList标签,id为 dataListItem
$.ajax({
type: "POST",
url:"api/xx/xxx/xxxxxx?condition="+condition,
dataType: "json",
contentType:"application/json",
// data:JSON.stringify(data),
success: function (data) {
var dataBase = data.entity;