如何显示jQuery实例的所有键和值。我写了这段代码但没用。
html格式:
<input id="a" type="text">
查询:
$(function() {
$("#a").autocomplete({
source:["abc","def","ghi"]
});
var t="<div class='show'>";
$.each($("#a").autocomplete( "instance" ),function(key,value){
t+= key +" = " + value + "</br>";
});
t+="</div>";
$("body").append(t);
});
这个错误
jquery-1.10.2.js:516 Uncaught Error: no such method 'instance' for autocomplete widget instance