title: style.display as function is not hiding elements
body: <p>I have a very basic main.js file I and want to hide and show some elements based on some conditions.
  The problem is that when I launch the index.html the elements are not hiding properly.</p>
  <p>Can anyone help me please?</p>
  <p>`</p>
  <pre><code>init = async () =&gt; {
      hideElement(userInfo);
      window.web3 = await Moralis.Web3.enable();
      initUser();
  }
  
  initUser = async () =&gt; {
      if(await Moralis.User.current()){
          hideElement(userConnectButton);
          showElement(userProfiletButton);
      }else{
          showElement(userConnectButton);
          hideElement(userProfiletButton);
      }
  }
  
  login = async () =&gt; {
      try {
          await Moralis.Web3.authenticate();
          initUser();
      } catch (error) {
          alert(error)
      }
  }
  
  logout = async () =&gt; {
      await Moralis.User.logOut();
      hideElement(userInfo);
      initUser();
  }
  
  openUserInfo = async () =&gt; {
      user = await Moralis.User.current();
      if (user){
          showElement(userInfo);
      }else{
          login();
      }
  }
  
  hideElement = (element) =&gt; element.style.display = &quot;none&quot;;
  showElement = (element) =&gt; element.style.display = &quot;block&quot;;
  const userConnectButton = document.getElementById(&quot;btnConnect&quot;);
  userConnectButton.onclick = login;
  
  const userProfiletButton = document.getElementById(&quot;btnUserInfo&quot;);
  userProfileButton.onclick = openUserInfo;
  
  const userInfo = document.getElementById(&quot;userInfo&quot;);
  document.getElementById(&quot;btnCloseUserInfo&quot;).onclick = () =&gt; hideElement(userInfo);
  document.getElementById(&quot;btbLogOut&quot;).onclick = () =&gt; hideElement(logOut);
  </code></pre>
  <p>`</p>