-3

I have a Javascript function :

$('.myclass').click(function() {
  $('.myclass2').each(function(e) {
    $(this).removeClass('myclass3').addClass('myclass4');
  });
});

I would wish that the changes remain all the time for the user with jquery cookie.

Do you know how can it be done?

Fluidouix
  • 57
  • 1
  • 1
  • 8

1 Answers1

0

Use jQuery Cookie plugin:

Set a cookie

$.cookie("example", "foo");

Get a cookie

alert($.cookie("example"));
Munawir
  • 3,346
  • 9
  • 33
  • 51