first of all, I apologize that I don't speak English, I am trying to improve in this language.
I have a problem that I don't know how to solve it, I have a web in WordPress and it creates buttons dynamically with some dynamic classes, I need to take 1 of those classes to do the following:
Let's imagine that we have 5 buttons, when I clicked on 1 of those 5 that the other 4 buttons are hidden and this is saved in the local storage, ie everything is kept in the browser.
I have this code:
$('.dce-button').click(function(event){
$(this).attr('data-id' , 'Next');
localStorage.setItem("class", "noDisplay");
localStorage.setItem("noDisplay", "true");
$('.dce-button').not(this).each(function(){
$(this).toggleClass("noDisplay");
});
})
I use it to select the button I need and WORKS, it disappears the other 4 but I don't know how to keep it with the local storage, Is someone can help me?