@jonatandor35 So it would look more like this?
let states = {};
$w . onReady (() => {
const storedStates = local . getItem ( ‘pageStatus’ );
if ( storedStates ){
states = JSON . parse ( storedStates );
//and for the buttons as well
}
$w ( ‘#button1, #button2’ ). onClick (({ target })=> {
states [ target . id ] = ‘clicked’ ;
storeData ();
});
})
function storeData ( ){
local . setItem ( ‘pageStatus’ , JSON . stringify ( states ));
})
where would I add this into the existing original code? or the example 2 button test page?