title: How to set value inside div in JS
body: <p>I have some code that looks like this:</p>
  
  <pre><code>document.getElementById("error").style.display = 'block';
  </code></pre>
  
  <p>and when this happens I also want to display the error that is supposed to be shown which is stored in another JS variable.  How can I add the value of that variable to the div which has id="error"</p>
  
  <p>Thanks!</p>