localStorage can only store strings. You can't store DOM nodes in it, JS will just go "yeah that doesn't work, let me convert it to a string first" and will use the generic "object type in brackets" string.
If you want to store an HTML element, don't store the element itself but store its outerHTML source code, which is a string.
// convert page element to string:
function storeElement(element, keyName) {
localStorage.setItem(keyName, element.outerHTML);
}
// reconstitute the page element from string:
function retrieveElement(keyName, preserve=false) {
const stored = localStorage.getItem(keyName);
if (!preserve) localStorage.removeItem(keyName);
const helper = document.createElement(`section`);
helper.innerHTML = stored;
return helper.childNodes[0];
}