mardi 3 février 2015

how to call to a specific cookie in JS

How do i do this, W3Schools is not helpful here is my code



document.cookie="krul=1";
var x = document.cookie;
if(x == 1){
document.getElementById("krul").src="http://ift.tt/1x85hCQ";
}


I created a cookie kruuuul=1 then I try assingning it to x and comparing it in a if statement.


Aucun commentaire:

Enregistrer un commentaire