From cb07e90e63ae8ec4ab1f91fe01630f7cc0cd8770 Mon Sep 17 00:00:00 2001 From: Yannick Francois Date: Fri, 28 Sep 2018 22:59:58 +0200 Subject: [PATCH] =?UTF-8?q?Cr=C3=A9ation=20du=20fichier=20js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/parametres.html | 19 +------------------ public/script.js | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 public/script.js diff --git a/public/parametres.html b/public/parametres.html index a22d98be..2a855f4e 100644 --- a/public/parametres.html +++ b/public/parametres.html @@ -40,24 +40,7 @@ - + diff --git a/public/script.js b/public/script.js new file mode 100644 index 00000000..a46978f4 --- /dev/null +++ b/public/script.js @@ -0,0 +1,19 @@ +window.onload = () => { + var monStockage = localStorage; + if(localStorage.getItem('type_sondage') == undefined) { + localStorage.setItem('type_sondage', 'classique'); + } + + document.querySelector('#type_sondage').addEventListener('change', function() { + const selectedType = this.options[this.selectedIndex].text; + localStorage.setItem('type_sondage', type_sondage); + console.log(selectedType); + if(selectedType == "classique") { + document.querySelector('#next').href = "reponses.html"; + } else { + document.querySelector('#next').href = "dates.html"; + } + console.log(document.querySelector('#next')) + }) +} +