title: How to check whether document.getElementById gives empty result?
body: <p>When searching for one or more dom elements using <code>document.getElementById</code>, a single dom element is returned with <code>typeof(node) -&gt; "object"</code>. </p>
  
  <p>If no dom element is found for the query, a <code>null</code> object is returned which also gives <code>typeof(node) -&gt; "object"</code>.</p>
  
  <pre><code>caseOne = document.getElementById('contentSub')
     -&gt; &lt;div id="contentSub"&gt;
  typeof(caseOne)
     -&gt; "object"
  
  caseTwo= document.getElementById('qwert')
     -&gt; null
  typeof(caseTwo)
     -&gt; "object"
  </code></pre>
  
  <p>How to check whether a call to <code>document.getElementById</code> has been successful, in the sense that a dom element has been returned that may be further processed?</p>