title: How to Check if a Div is Empty and Then Execute Action
body: <p>I'm Building a Personal Assistant with HTML5, CSS, &amp; <strong>Javascript</strong></p>
  
  <p>This is what my <em>current</em> Problem is.</p>
  
  <p>I Have a <code>&lt;div&gt;</code> that contains scripts with the responses for when a Question is asked and if the question matches one it writes that response.</p>
  
  <p>I Need a Script that will check if this div is empty, in <strong>Javascript</strong>, not <strong>jQuery</strong></p>
  
  <p>I need to check if the div is empty because that means there is no response.</p>
  
  <p>Then for it to redirect to an the error page.</p>
  
  <p>a Question &amp; the response to it would look like this:</p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
  {
  var q = getValue("q");
  var name = getValue("name");
  }
  if (q == 'Whats+up') {
  document.write("Not much " + name + ".");
  }
  else {
  
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>This is the last code I tried:</p>
  
  <pre><code>            &lt;script&gt;
  
      var theDiv = document.getElementById("responce");
      var q = getValue("q");
      if(theDiv.innerHTML == ''){
      window.location = 'error.html?name=Brandon&amp;q='+q;
      }
    &lt;/script&gt;
  </code></pre>