JSFiddle - React, Tailwind, and code Playground
HTML
<button id="mostrar" onClick="javascript: mostrarBt();">Mostrar Botão</button>
<button id="esconder" onClick="javascript: escondeBt();">Esconder Botão</button>
<button id="botao1">Botão 1</button>
CSS
button#botao1 {display: none; margin-top: 5px;}
#esconder{ display: none; margin-top: 5px; }
JavaScript
window.onload = function(){
if(localStorage.mostrabotao2){
mostrarBt();
}
}
function mostrarBt() {
document.getElementById("botao1").style.display="block";
document.getElementById("esconder").style.display="block";
localStorage.mostrabotao2 = 1;
}
function escondeBt() {
document.getElementById("botao1").style.display="none";
document.getElementById("esconder").style.display="none";
localStorage.clear();
}