I have a input field with ajax which returns list of elements matching with the input.
<input name="sku_id" type="text" placeholder="SKU" class="form-control" autofocus>
$('[name="sku_id"]').on('keyup', function(event){
event.preventDefault();
var sku_id = $('[name="sku_id"]').val();
if ( sku_id.length > 2){
$.ajax({
url : "/sku_auto/",
type : "POST",
data : {action:'search_sku',
sku_id:sku_id},
success : function(response){
var sku_list = response.sku_list;
console.log(sku_list);
},
error : function(xhr,errmsg,err) {
console.log(xhr.status + ": " + xhr.responseText);
}
});
}
});
The ajax returns a list of elements. I want to ask how to display the list below the input?
Most examples recommended using JQuery-ui's autocomplete feature, but on using the cdn it is messing with the rest of code.
I want to know if i have to write the css for this or i can append it directly?