From 8db7e95e007ac643f8dd4c1bfa217c64766d7c96 Mon Sep 17 00:00:00 2001 From: Alex Kunze Date: Fri, 13 Dec 2019 17:01:21 -0500 Subject: [PATCH] add new question code --- js/main.js | 17 ++++++++++++++++- questioncreate.html | 29 +++++------------------------ questionlist.html | 6 +++--- 3 files changed, 24 insertions(+), 28 deletions(-) diff --git a/js/main.js b/js/main.js index 0c8f0e5..bba2a05 100644 --- a/js/main.js +++ b/js/main.js @@ -1 +1,16 @@ -const database = firebase.firestore(); +const form = document.getElementById('questionform'); +const submit = document.getElementById('questionsubmit'); + + +function addQuestion() { + const input = document.getElementById('questiontext'); + const ul = document.getElementById('questionul'); + + var node = document.createElement("li"); + var textnode = document.createTextNode(input.value); + + node.appendChild(textnode); + ul.appendChild(node); +} + +submit.addEventListener('click', addQuestion()); \ No newline at end of file diff --git a/questioncreate.html b/questioncreate.html index 16614b5..3eb8726 100644 --- a/questioncreate.html +++ b/questioncreate.html @@ -36,32 +36,13 @@
Question Text:
-
- - - - - - - - + + + diff --git a/questionlist.html b/questionlist.html index 45d001d..16bda59 100644 --- a/questionlist.html +++ b/questionlist.html @@ -28,10 +28,10 @@
Question ListAdd Question
-