diff --git a/activities.html b/activities.html
index 436a3f9..c733109 100644
--- a/activities.html
+++ b/activities.html
@@ -14,7 +14,7 @@
@@ -30,7 +30,7 @@
-
+
@@ -541,8 +541,28 @@
city_names.sort((a,b)=>a-b);
//console.log(city_names)
+ // function D_Fun_C(data){
+ // data.map((({city})=>{
+ // var showcities=document.querySelector("#citynames");
+ // var p=document.createElement("p");
+ // var line=document.createElement("hr");
+ // p.innerHTML=city;
+
+ // showcities.append(p,line);
+ // })
+ // }
+
+
+
+
+
+
+
+
+ // cities list appending here
+
for(var i=0; i
{
@@ -655,6 +675,85 @@
+ // debouncing funvtion
+
+document.getElementById("typesearch").addEventListener("keyup",()=>{
+ debounce(mainFun);
+});
+
+let id;
+function debounce(func){
+ if(id){
+ clearTimeout(id);
+ }
+ id = setTimeout(() => {
+ func();
+ },500)
+};
+
+
+const mainFun = async () => {
+ let query1 = document.getElementById("typesearch").value;
+ try{
+ let response = await fetch(`http://localhost:3000/City_name?q=${query1}`);
+ let data = await response.json();
+ console.log(data);
+ showDataFun(data);
+ }
+ catch(err){
+ console.log(err);
+ }
+
+}
+
+var showcities1=document.querySelector("#citynames");
+function showDataFun(data){
+ showcities1.innerHTML = "";
+ data.forEach(function(elem){
+ var p=document.createElement("p");
+ var line=document.createElement("hr");
+ p.innerText = elem.city;
+ showcities1.append(p,line)
+ })
+
+}
+
+
+
+
+// const debounce = (func,delay) =>{
+// let id;
+// return function(query){
+// if(id){
+// clearTimeout(id);
+// }
+// id=setTimeout(function(){
+// func(query);
+// },delay)
+// }
+// }
+
+// function fetchItems(query){
+// console.log(query)
+// var showcities1=document.querySelector("#citynames");
+// var p1=document.createElement("p");
+// var line1=document.createElement("hr");
+// for(var i=0;i
+
+
+
+
-

+
@@ -233,7 +237,9 @@
-
+
+
+