Using jQuery autocomplete.. Want to replace “hello” in script below with javascript to identify either the “name” or “id” of the input field… (Will have several instances on a single page, so I’m not using ID, only class…)
$(".suggest").autocomplete({
source: function(request, response) {
console.log(request.term);
$.ajax({
url: "http://www.mysite.com/suggest/",
dataType: "json",
data: {
'q': request.term ,
'r': "hello"
},
success: function(data) {
response(data);
}
});
},
});
From what I remember it should be this.element: