get a div height when it's not specified jquery code example Example: jquery get document height let height = ($(window).height() || $("body").height());