title: Uncaught TypeError: Cannot set property 'onclick' of null onclick not working
body: <p>see below is my javascript,</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  document.getElementById('auth').onclick=change;
  function change(){
      this.className="account_holder";
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>html is</p>
  
  <pre><code>&lt;td id="auth" class="authorised_reportericon" &gt;
                          &lt;a href="{% url incident.views.authorised_reporter %}"&gt;
                          &lt;p align="center" style="color:black;font-size:16px;"&gt;Authorised Reporters&lt;/p&gt;&lt;/a&gt;
                      &lt;/td&gt;
  </code></pre>
  
  <p>I assigned td's id for onclick,but it is trowing error as Uncaught TypeError: Cannot set property 'onclick' of null</p>