The example in this article describes how to set the body height to the browser height using JavaScript. Share it with everyone for your reference. The specific implementation method is as follows:
For the height of a div node to be implemented as a percentage, its parent node must have a certain height. Therefore, if the child node under the body node wants to use a percentage to determine the height, it must give a height to the body.