title: TypeError: cannot read property 'css' of null
body: <p>I am trying to set the minimum-height of my div element by referring to its class name but it comes back with an error: <strong>TypeError: cannot read property 'css' of null</strong>.</p>
  
  <p><strong>HTML element</strong>:</p>
  
  <pre><code>&lt;div class="container contentContainer" id="topContainer"&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-md-6 col-md-offset-3" id="topRow"&gt;
                  &lt;p class="bold"&gt;Please scroll down for more information &lt;/p&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p><strong>Javascript</strong>:</p>
  
  <pre><code>&lt;!-- jQuery (necessary for Bootstrap's JavaScript plugins) --&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"&gt;&lt;/script&gt;
  &lt;!-- Include all compiled plugins (below), or include individual files as needed --&gt;
  &lt;script src="js/bootstrap.min.js"&gt;&lt;/script&gt;
  
  &lt;script&gt;
      $(function () {
          var x = document.getElementsByClassName("contentContainer");
          alert(x);
          if(x != null)
          {
              $(".contentContainer").css('min-height',$(window).height());
          }
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Any suggestions as to why am I getting this error? Kindly let me know.</p>
  
  <p>The problem occurs when I include my external javascript file:</p>
  
  <pre><code>&lt;!-- &lt;script type="text/javascript" src="js/monthly.js"&gt;&lt;/script&gt; --&gt;
  </code></pre>