title: JavaScript - if statement textContent not showing up in html when clicking button
body: <p>I am having problems creating if statements in JS here is my code:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const email = document.querySelector("#email");
  
  if (signupBtn) {
    signupBtn.addEventListener("click", function() {
      accountData.push("Email: ", email.value);
      email.value = "";
      localStorage.setItem("accountData", JSON.stringify(accountData));
      AccountData()
    })
  }
  
  function AccountData() {
    let listData = ""
    for (let i = 0; i &lt; accountData.length; i++) {
      listData += "&lt;p&gt;" + accountData[i] + "&lt;/p&gt;"
    }
    dataLogger.innerHTML = listData
  }
  
  const errMsg = document.querySelector(".errorMessage")
  
  if (email === null || email === "") {
    errMsg.textContent = "Please enter your email address"
    isValidEmail = false;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;fieldset class="account_options"&gt;
    &lt;p&gt;
      &lt;label for="email" class="email"&gt;Email Address: &lt;/label&gt;
      &lt;input name="email" placeholder="Enter your email" id="email"&gt;
      &lt;p class="errorMessage"&gt;&lt;/p&gt;
    &lt;/p&gt;
    &lt;br&gt;
    &lt;p&gt;
      &lt;div&gt;
        &lt;button type="submit" class="signup_login" id="signup-btn"&gt;Sign up&lt;/button&gt;
        &lt;p class="signup-data" hidden&gt;&lt;/p&gt;
      &lt;/div&gt;
      &lt;/section&gt;
  &lt;/fieldset&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>When the value if <em>null</em> or <code>&quot;&quot;</code> the <code>textContent</code> is not showing the string when button is clicked. Nothing in the <code>if</code> <code>(email)</code> statement shows up in the HTML file. I currently cannot find any solution online about this bug or error.</p>