i am using this:
$newPostID_fromCookie = $_COOKIE['scrollToBottom']+5000;
echo "
  <script>
  window.onload = function () {
    //document.getElementById('$newPostID_fromCookie').scrollIntoView();
    alert('$newPostID_fromCookie');
  }
  </script>
";
This correctly shows the value from the cookie in the alert, but i am getting 'is null' error when trying to use the value in the getElementById.
How can i use the value in this?
 
     
     
    