AutoComplete for jQuery

https://www.devbridge.com/sourcery/components/jquery-autocomplete/#

var data = [
    { value: '人民币', data: '¥' },
    { value: '美元', data: '$' },
    { value: 'dollar', data: '$' },
    { value: '英镑', data: '£' },
  ];
$('#autocomplete').autocomplete({
	    lookup: data,
	    tabDisabled:true, 
	    onSelect: function (suggestion) {
	    	$("#schoolId").val(suggestion.data);//选择内容之后的处理
	    },
	    onInvalidateSelection:function(){
	    	$("#schoolId").val("");//当选择后的内容发生改变时
	    }
	  });

相关推荐