title: Uncaught TypeError: Cannot set property 'src' of null for ImageButton
body: <p>I've searched through similar questions but I didn't find something to work for me. </p>
  
  <p>I want to change the ImageURL of an ImageButton on a certain condition (t>80), but what I get is <em>Uncaught TypeError: Cannot set property 'src' of null</em>. My <code>&lt;head&gt;</code> code is:</p>
  
  <pre><code>    $(document).ready(function () {
             //doing other stuffs
          setInterval(function () {
  
                           $(".industrial.tank.size.one").each(function () {
                              $(this).industrial(t);
  
                              if (t &gt; 80) {
  
                                  // document.getElementById('btnV11').ImageURL = "~/Images/Valve/Valve-gray-left.png";
                                  document.getElementById('btnV11').src = "../../Images/Valve/Valve-gray-left.png";           
                          });  
          }, 3000);
      });
  </code></pre>
  
  <p>and in <code>&lt;body&gt;</code>:</p>
  
  <pre><code>&lt;asp:ImageButton ID="btnV11" runat="server" Height="51px" ImageUrl="~/Images/Valve/Valve-alarm-left.gif" Width="53px" OnClientClick="ShowControlPanel_P11(); return false;"/&gt; 
  </code></pre>
  
  <p>Why do I get this error?</p>