title: Code don't work, can't read property 'className' of undefined
body: <p>What is wrong with this code?</p>
  
  <pre><code>var divarray = [];
  var articleHTML = [];
  var absHTML;
  var keyHTML;
  var bodyHTML = [];
  var i = 0;
  divarray = document.getElementById("yui-main").getElementsByTagName("div");
  for ( var j in divarray) {
      if(divarray[i].className == "articleBody"){
          articleHTML = divarray[i];
          for( var k in articleHTML ){
              bodyHTML[i] = '';
              if(articleHTML[i].className == "issueMiniFeature"){continue;}
              if(articleHTML[i].className == "abstract"){absHTML = articleHTML[i]; continue;}
              if(articleHTML[i].className == "journalKeywords"){keyHTML = articleHTML[i]; continue;}
              bodyHTML[i] = articleHTML[i];
          }
          break;
      }
      i++;
  }
  </code></pre>
  
  <p>The error I get is:</p>
  
  <pre><code>TypeError: Cannot read property 'className' of undefined
  </code></pre>
  
  <p>I am using Google Chrome.</p>