ming 3 vuotta sitten
vanhempi
commit
f858bd464f
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  1. 5 1
      index2.html

+ 5 - 1
index2.html

@@ -133,7 +133,11 @@
       document.getElementById("mySidenav").style.width = "0";
     }
     function load_data(id){
-      alert(id);
+      var filtered = collection.filter(function (item) {
+        return item.id === id;
+      });
+      alert(filtered.title);
+
     }
     </script>
   <style>