You can use wix-storage to save the element’s status either by session or local (permanently) . In the page’s onReady() event handler, you can then get the element’s status from storage and then set the element’s status according to the value retrieved from storage.
You want to do something like this:
import {local} from 'wix-storage';
$w.onReady(function () {
let status = local.getItem("element_disabled");
// status has a string value
if(status === 'true') {
$w("#element").disable(); // if 'true', element disabled
}
else {
$w("#element").enable(); // if not 'true', element enabled
}
});
... the rest of your code ...
// somewhere in your code, you disable the element
$w("#element").disable();
// and when you do that, save the disabled status
local.setItem("element_disabled", "true");
Disclaimer: this hasn’t been tested, but this is the general idea.