Home >Web Front-end >JS Tutorial >Use documentElement to correctly obtain the size of the currently visible area_javascript tips
Other methods are not applicable. Only this documentElement can correctly obtain the size of the current visible area
var w = parseInt(document.documentElement.clientWidth); var h = parseInt(document.documentElement.clientHeight);