JavaScript
Article

jQuery Get Length of Webpage

By Sam Deering

jQuery code snippet to get the length (height) of a web page.

var webpage = $("body");
var webpage_height = webpage.height();
alert(webpage_height);

Note you can also use: $(document).height() or $(window).height() instead of body selector.

Recommended

Learn Coding Online
Learn Web Development

Start learning web development and design for free with SitePoint Premium!

Get the latest in JavaScript, once a week, for free.