Here is my code
if(jQuery.cookie("box1") == "close") {
jQuery("#box1").remove();
};
I already have individual cookies for each box. Now i want to check the cookies with jquery and remove the corresponding box if the cookie value is ‘close’.
How can i make that code work with other boxes? .Other boxes have similar IDs (box2, box3) and there’s a cookie for each one
I don’t really think the cookie plugin has an option to iterate over cookies, but you could get all the set cookies yourself and just iterate over them to see if the value is
close, and then remove the corresponding element, something like :