title: Cannot read property 'textContent' of null at renderTime
body: <p>I'm trying to create a working clock with JavaScript, but the code won't run. I'm getting the following error in my console:</p>
  
  <blockquote>
    <p>Cannot read property 'textContent' of null at renderTime</p>
  </blockquote>
  
  <p>This is the HTML:</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;script src="js/jquery-3.2.1.js" charset="utf-8"&gt;&lt;/script&gt;
    &lt;script src="js/alarm.js" charset="utf-8"&gt;&lt;/script&gt;
    &lt;title&gt;Alarm Clock&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;div id="clockDisplay" class="clockStyle"&gt;3 : 15 : 25 AM&lt;/div&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>And this is the JavaScript:</p>
  
  <pre><code>function renderTime() {
  
    var currentTime = new Date();
    var diem = "AM";
    var h = currentTime.getHours();
    var m = currentTime.getMinutes();
    var s = currentTime.getSeconds();
  
    if (h == 0) {
      h = 12;
    } else if (h &lt; 12) {
      h = h - 12;
      diem = "PM"
    }
  
    if (h &lt; 10) {
      h = "0" + h;
    }
  
    if (m &lt; 10) {
      m = "0" + m;
    }
  
    if (s &lt; 10) {
      s = "0" + s;
    }
  
  
  
    var myClock = document.getElementById('clockDisplay');
    myClock.textContent(h + ":" + m + ":" + s + "" + diem);
    setTimeout('renderTime()', 1000)
  
  }
  
  renderTime();    
  </code></pre>