title: Get the total height of HTML document in jQuery
body: <p>I want to retrieve using jQuery the total height of my HTML document. I tried so many things, the max height I could get is the total height of the viewport, never taking into account if there was a vertical scrollbar or not. The following screen indicates what I want:</p>
  
  <p><img src="https://i.stack.imgur.com/XwgqH.png" alt="enter image description here"></p>
  
  <pre><code>$(document).height();  // return 898, which is only the height of the current visible part of the page
  $(window).height();  // return 881
  $("html").height();  // return 898
  $("body").height();  // same
  $("div#main").height();  // same
  $(document).outerHeight();  // i'm wondering how can i do this ...
  </code></pre>
  
  <p>The tests was made on Firefox and Chrome browsers.</p>
  
  <p>Can someone explain if it's even possible to do this? </p>
  
  <p>Apparently, even if my problem is not solved, it's bound to a weird behaviour of SharePoint. I'm trying to get the document height on a SharePoint 2013 page, but it will always return the viewport height. </p>