diff --git a/public/responses.html b/public/responses.html
index 852daaa5..d1ede1c7 100644
--- a/public/responses.html
+++ b/public/responses.html
@@ -29,14 +29,12 @@
diff --git a/public/script.js b/public/script.js
index 09b06067..a99b8710 100644
--- a/public/script.js
+++ b/public/script.js
@@ -52,6 +52,16 @@ const createModal = (text) => {
});
}
+const buildTextField = () => {
+ var field = document.createElement("input")
+ var deleteButton = document.createElement("button")
+ var fieldBloc = document.createElement("span")
+ fieldBloc.appendChild(field);
+ fieldBloc.appendChild(deleteButton);
+ return fieldBloc
+
+}
+
$$('input').forEach((inputElement) => {
inputElement.addEventListener("change", () => {
localStorage[inputElement.name] = inputElement.value
@@ -62,13 +72,13 @@ if($("#add-response-choice")) {
$("#add-response-choice").addEventListener('click', (e) => {
e.preventDefault();
let response = document.createElement("li");
- let text = document.createTextNode("Blabla");
- response.appendChild(text);
+ response.appendChild(buildTextField());
$("#responses").appendChild(response);
});
}
+
$$(".next").forEach((button) => {
button.addEventListener("click", (e) => {
$$(".toggle-field").forEach((field) => {