title: How can I fix - Uncaught TypeError: Cannot read property 'scrollHeight' of undefined
body: <p>I hope somebody will help me to fix the issue. </p>
  
  <p>I have a follow script for chrome console , it worked fine the last couple of days , however running it today I started to receive this Error ( below ) . 
  I would highly appreciate if somebody can help me fix the code issue , the code and the error is attached below . Thanks in advance for help. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var jq = document.createElement('script');
  jq.src = "//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"; //Loads JavaScript
  document.getElementsByTagName('head')[0].appendChild(jq);
  jQuery.noConflict()</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>window.setInterval(function(){
  var x = 0;
  $("button:contains('Follow')").each(
  function(){ if($(this).text()=="Follow"){
  if(x==2) return false; 
  $(this).trigger("click");
  $('._4gt3b').scrollTop($('._4gt3b')[0].scrollHeight);
  x++;}
  }
  )
  $('._4gt3b').scrollTop($('._4gt3b')[0].scrollHeight); console.log('loop');
  }, 70000); </code></pre>
  </div>
  </div>
  </p>
  
  <p>Here is the error that I'm receiving after running the script </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&gt;VM137:7 Uncaught TypeError: Cannot read property 'scrollHeight' of undefined  
          at HTMLButtonElement.&lt;anonymous&gt; (&lt;anonymous&gt;:7:40)  
          at Function.each (jquery.min.js:2)  
          at n.fn.init.each (jquery.min.js:2)  
          at &lt;anonymous&gt;:3:32   </code></pre>
  </div>
  </div>
  </p>