Browse Source

add log test

ming 3 years ago
parent
commit
f858bd464f
1 changed files with 5 additions and 1 deletions
  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>