Javascript

Topic: JS Window

How to get height and width of different browser in Javascript?

Following examples illustrate the different ways to get height and width of different browser.For Non-IEvar Width;var Height;Width = window.innerWidth;Height = window.innerHeight;For IE 6+ in standards compliant modeWidth = document.documentElement.clientWidth;Height = document.documentElement.clientHeight;For IE 4 compatibleWidth = document.body.clientWidth;Height = document.body.clientHeight;

Browse random answers: