From 8e17912802e54ee625bbca83b33f5da961282883 Mon Sep 17 00:00:00 2001 From: techgaun Date: Thu, 30 Mar 2017 13:17:39 -0500 Subject: [PATCH] wrap with form --- index.html | 14 ++++++++------ js/main.js | 5 +++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 932e039..8ac52b6 100644 --- a/index.html +++ b/index.html @@ -15,12 +15,14 @@
-
- - - - -
+
+
+ + + + +
+
diff --git a/js/main.js b/js/main.js index 2d6859e..f379e7d 100644 --- a/js/main.js +++ b/js/main.js @@ -1,3 +1,8 @@ +document.getElementById('form').addEventListener('submit', (e) => { + e.preventDefault() + fetchData() +}) + function fetchData() { const repo = document.getElementById('repo').value const re = /[-_\w]+\/[-_.\w]+/