i want to use local storage to directly go to my account without having to make a new one at <div id='first'>
<div id="first"> <h1>make an account</h1> <form onsubmit="return false"> new Name:<input id='nus' type="text" placeholder="Type your name here" > new password:<input id='npass' type="password" placeholder="Type your password here" > <button onclick="addaccount()" type="submit">add</button> </div> <div id="scnd" style="display: none;"> <p id='txt'></p> <form onsubmit="return false"> Name:<input id='bar' type="text" placeholder="Type your name here" > password:<input id='pass' type="password" placeholder="Type your password here" > <button onclick="insert()" type="submit" id='insbtn'>insert</button> </form> <h1 id="acc" style="display: none;"> example for text <br>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Magni ipsum voluptatibus quis eos laudantium commodi quae pariatur magnam in rem odio, neque officia tempora repellat ea soluta atque eius expedita!</h1> </div> <script> function addaccount(){ var first=document.getElementById('first') const nus=document.getElementById('nus').value; const npass=document.getElementById('npass').value; localStorage.setItem('nus',nus) localStorage.setItem('npass',npass) first.style.display='none' scnd.style.display='block' } function insert(){ var scnd =document.getElementById('scnd') var txt=document.getElementById('txt'); var bar =document.getElementById('bar').value; var pass=document.getElementById('pass').value; var insbtn = document.getElementById('insbtn'); var acc=document.getElementById('acc') localStorage.setItem('name',bar); localStorage.setItem('password',pass); var getus=localStorage.getItem('name') var getpass=localStorage.getItem('password'); if (localStorage.getItem('nus')==bar&&localStorage.getItem('npass')==pass){ acc.style.display='block'; txt.innerHTML='hello'+' '+getus } else{ txt.innerHTML='error not your account' } } </script>