Create cookie in javascript

hello all

i Want to know i’m student and i want to create cookie function for save theme css when the theme change.

This is my javascript.js

function start(){
var choix = document.getElementById(“Choix”);
choix.innerHTML = “Personnaliser l’affichage”;
affiche(1);
console.log(document.cookie);
}

function affiche(i){
var image = document.getElementById(“image”);
image.src=“…/Images/od”+i+“.jpg”;
i++
if (i == 14){
i=1;
}
setTimeout(affiche,3000,i);
}

function liste_theme(){
var liste = document.getElementById(“Choix”);
liste.innerHTML= "Thème 1 Thème 2 Thème par défaut ";
}

function css(i){
var css=document.getElementById(“css”).href=“css/styles”+i+“.css”;
document.cookie = choix;theme;
}

work

I have three css styles1 styles2 styles3

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.