Hide button after form submit and save state to localstorage

You can save an item to local storage with one line. Something like this…

localStorage.setItem("isDisabled", "true");

Then you can check for the value later by doing something like this…

if(localStorage.getItem("isDisabled")===null) {
   //
}

Or update the value from true to false …

localStorage.setItem('isDisabled', 'false');