Essentially, it takes the 'group' of the buttons (by using .querySelectorAll to select all inputs that have the same name of the radio button) then saving the state of each radio button.
Which means that in the group, only one is checked and the others are not checked.
Though I am having problems with the saving of the value of a variable since after the second reload of the page, it will point to the last value.
The steps to see the problem (if there is an update() in the oninput of the radio button) is:
Click a radio button.
Reload the page, the variable will point to the last value in the group.
If there is no update() on the oninput, it will take two reloads of the page to point to the last value in the group.
EDIT: Seems to have fixed it by removing the triggerEvent upon loading the state/value of the inputs. Though, I'm sure there is a good reason why the 'triggerEvent' are there.
Thanks! I've put this on my todo list and will fix tomorrow. Will probably end up copy-pasting your solution (with attribution/credit ๐) because if history is any guide I'll end up messing things up otherwise lol. But will definitely look into the triggerEvent stuff and try to make sure it all makes sense - been a long while since I looked that that plugin
For some reason I wasn't able to replicate the bug you mentioned even though I think I basically copy-pasted your changes, and didn't remove triggerEvent. Can you fork this and make a replication? https://perchance.org/remember-user-inputs-radio-example#edit