const form = document.getElementsByClassName("form-control"); const mail = form[0].value; const pass = form[1].value; const data = { email: mail, password: pass }; localStorage.setItem("auth", JSON.stringify(data));
the above code is used to store the email and password in the local storage of the user.