Answer the question
In order to leave comments, you need to log in
How to delete cookies on second click on the cookie button?
There is a button, by pressing which the value is written to the cookie. How can I make this value disappear or overwrite on another click? In short, the functionality is similar to ToggleClass
Answer the question
In order to leave comments, you need to log in
$('#button').click(function() {
if(!$.cookie('but')){
$.cookie('but', true);
} else {
$.removeCookie('but');
}
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question