DEV Community

Syed Hasan Abid
Syed Hasan Abid

Posted on

Ajax get data using search bar under option list

Anyone help me???
i just need a search bar under option list that search data from list....

var map = null;
$(document).ready(function() {
var allCitiesList = $.ajax({
type: "GET",
url: http:/Leop/api/Compaign/GetDestCalCity,
data: "",
async: false
}).responseText;
var searchbar = <input type="text" placeholder="search city" />;
var cityLocationsObj = JSON.parse(allCitiesList);
var cityLocationsListing = <option>Please Select City</option>;
cityLocationsObj.map(x => {
//debugger;
cityLocationsListing += <option value="${x.City_ID}">${x.City_NAME} </option>;
});
//debugger;
$('#citiesList').html(cityLocationsListing);
});

Top comments (0)