Sag mir erst mal, wo hier der Fehler ist:
Der fehler ist ganz einfach ich komme zwar von 1 auf 0 aber nicht umgekehrt und noch schlimmer: Die var wird nicht gespeichert.
Leicht modifiziert nach lina:
function minusjalo () {
x = cookiearray[2][1]
if (x==1) {
document.getElementById("jalo").firstChild.nodeValue = "Geöffnet";
}
if (x==0) {
document.getElementById("jalo").firstChild.nodeValue = "Geschlossen";
}
document.cookie = "i=" + i + "; ; expires=" + ablauf.toGMTString();
document.cookie = "t=" + t + "; ; expires=" + ablauf.toGMTString();
document.cookie = "x=" + x + "; ; expires=" + ablauf.toGMTString();
alert (x)
}