Missing element breaks script (getElementById)
<p>If the ID doesn't exist the script breaks. Why?</p>

<p>How to chache the_lis?</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset="utf-8" /&gt;
&lt;title&gt;test&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;script&gt;
window.onload = function(){
alert('this will alert');
var the_id = document.getElementById('a_id_that_does_not_exist'),
the_lis = the_id.getElementsByTagName('li');
alert('this will NOT alert');
}
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
