framadate-responsive/public/script.js

22 lines
685 B
JavaScript
Raw Normal View History

2018-09-28 22:59:58 +02:00
window.onload = () => {
if(localStorage.getItem('type_sondage') == null) {
2018-09-28 22:59:58 +02:00
localStorage.setItem('type_sondage', 'classique');
}
console.debug(localStorage)
let typeSondageElement = document.querySelectorAll("*[data-group='record']")
typeSondageElement.forEach((currentElement) => {
currentElement.addEventListener('change', function() {
const selectedType = this.options[this.selectedIndex].text;
localStorage.setItem('type_sondage', type_sondage);
if(selectedType == "classique") {
document.querySelector('#next').href = "reponses.html";
} else {
document.querySelector('#next').href = "dates.html";
}
})
});
2018-09-28 22:59:58 +02:00
}