title: Check if class is present if else add height to a div
body: <p>What I'm trying to do is check if class exist. If present add height by 'X' px in another class if not add height by 'Y' px</p>
  
  <p>Not using Jquery. And it should be supported in IE8. <code>document.getElementsByClassName</code> is not supported in IE8 so used <code>className.match</code> but then again it started to get longer. My code below does not go past the 3rd <p></p>
  
  <p><a href="http://jsbin.com/gunomu/1/edit" rel="nofollow">JSBIN</a></p>
  
  <p>Any one with a short IE8 friendly code?</p>
  
  <pre><code>window.onload = window.onresize = function heightResize () {
  var browserHeight = window.innerHeight;
  var present=document.getElementsByTagName('p');
  alert(present.length);
   for (var i=0; i&lt;present.length; i++) {
    if (present[i].className.match(/\bbuttons-container\b/))
         {
   alert("Yes Present");
   document.getElementsByClassName("boxcontent")[0].style.height = browserHeight -150 + "px";
         } else {
  alert("Not Present");
  document.getElementsByClassName("boxcontent")[0].style.height = browserHeight -200 + "px";
                }
  
                }
  
                };
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code> &lt;p&gt;
  First Para
   &lt;/p&gt;
    &lt;table&gt;
    &lt;tr&gt;
    &lt;td&gt;
      &lt;p&gt;
  Second Paragraph
      &lt;/p&gt;
      &lt;div  id ="overlay_modal" class="boxcontent"&gt;
        Output
      &lt;/div&gt;
       &lt;/td&gt;
     &lt;/tr&gt;
     &lt;/table&gt;
  
    &lt;p&gt;
  Third Para
    &lt;/p&gt;
     &lt;p class="buttons-container"&gt;
  Buttons
     &lt;/p&gt;
  </code></pre>