Try and catch not functioning
<p>I'm trying to see if I can catch a null element, so far I have this code:ar offset = 0;</p>

<pre><code>var i = 0;
for(i = 0; i &lt; 17; i++) {
  obj = document.getElementById("comment" + i);
  obj.style.top = offset + "px";
  offset += obj.clientHeight;
}

function moveComments() {
  try {
    var i1 = 0;
    for(i1 = 0; i1 &lt; 17; i1++) {
      obj = document.getElementById("comment" + i1);
      obj.style.top = parseInt(obj.style.top) - 1 + 'px';
      if(parseInt(obj.style.top) &lt;= -obj.offsetHeight)
        obj.style.top = offset - obj.offsetHeight + "px";
    }
  }
  catch(err) {
    alert("D:");
  }
}

setInterval(moveComments, 15);
</code></pre>

<p>But whenever I do have a null element it won't catch the error or alert me. To make matters even worse, it doesn't print anything into the console either :(</p>
