get height of a div jquery respected to viewport code example Example: jquery get document height let height = ($(window).height() || $("body").height());