I have this Javascript code.
var navButton = document.getElementById("nav-button");
let outerlogouttrigger = false;
var email = document.getElementById("Email").value;
var password = document.getElementById("password").value;
document.getElementById("Login").onclick = function() {
  loginfunction()
};
function loginfunction() {
  sessionStorage.setItem('isLoggedin', 'true');
  //This is for making the changes instanteniously after clicking
  if (sessionStorage.getItem('isLoggedin') === 'true') {
    navButton.innerHTML = "Log out";
    navButton.classList.remove("btn-warning");
    navButton.classList.add("btn-success");
    outerlogouttrigger = !outerlogouttrigger; //not woring
  }
}
console.log(outerlogouttrigger);
console.log(email);
console.log(password);
// This if comes in effect after refresh
if (sessionStorage.getItem('isLoggedin') === 'true') {
  navButton.innerHTML = "Log out";
  navButton.classList.remove("btn-warning");
  navButton.classList.add("btn-success");
}I have 2 questions:
- How to  change the outerlogouttriggervalue which is not changing in my case.
- how to get the value of the emailandpasswordwhich is taken input in a html form. The input type ofemailis email and input type ofpasswordis password. I want to check if they are empty or not!
 
    