What is the difference between document.documentelement.clientheight and window.innerHeight?

  node.js, question

What is the difference between document.documentelement.clientheight and window.innerHeight? Why do so many people use window.innerHeight to get the window size on the mobile side? I tested that getting the document.documentelement.clientheight is the same value as getting window.innerHeight There is also why window.outerWidth can get the size on Android and why it is always 0 on Apple. …

There is a difference. The former is to obtain the width and height of body, while the latter is to obtain the width and height of HTML. it is divided into two writing methods to solve the compatibility problem. some browsers only recognize one of these two methods.