title: Uncaught typerror: cannot set property 'display' of undefined
body: <p>When I click on this div I want it to show an error message saying that it's too expensive</p>
  
  <p>I have tried changing the document.getElementByClassName into a variable, I didn't expect that to work though.</p>
  
  <pre><code>function hideError() {
    document.getElementsByClassName("errorMessage").style.display = "none";
  }
  function showError() {
    document.getElementsByClassName("errorMessage").style.display = "contents";
    setTimeout("hideError", 5000);
  </code></pre>
  
  <p>Uncaught TypeError: Cannot set property 'display' of undefined</p>